Skip to content

Security and Lock

Bulbasaur edited this page Dec 2, 2026 · 1 revision

Security and Lock

English · 한국어

Easy Diary has three separate security features, and they are easy to confuse because two of them ask for a PIN:

App lock Diary encryption
What it protects Opening the app One entry's title and body
PIN length 4 digits 6 digits
Where you set it Settings → Lock setting Reading view → ⋮ → Encrypt diary
What is stored The PIN itself, in the app's private preferences The encrypted title and body, plus a SHA-256 hash of the PIN
Can it be recovered? No No
Carried by a backup? Never Yes — the ciphertext and the hash are backed up as they are

The third feature is the backup password, covered at the end of this page.

1. App lock (PIN and fingerprint)

Settings → Lock setting

PIN lock

  • Turn on PIN lock setting, and the app asks you to enter a 4-digit PIN on its own keypad, then confirms it in a dialog that shows the number.
  • The lock is asked for when the app comes to the front, and again after you leave the app for more than a moment.
  • A wrong PIN closes the app. There is no attempt limit and no timer, but the app also does not stay open to be tried against, which makes a 4-digit PIN (10,000 combinations) impractical to guess on someone else's phone.
  • There is no official way to reset a forgotten PIN. The PIN is not sent anywhere. If you forget it and you have a backup, the way out is: reinstall (or clear app data), then restore the backup. If you have no backup, the entries are not recoverable through the app.

Fingerprint lock

  • Fingerprint lock needs a PIN first: the app refuses to enable it until a PIN exists, and it refuses to remove the PIN while fingerprint lock is on.
  • On the unlock screen the app offers the fingerprint sensor and the PIN keypad; the PIN is always the fallback.
  • If the fingerprints enrolled on the device change (a new fingerprint added, or all of them removed), the saved fingerprint key can no longer be used. The unlock screen then tells you to switch to PIN mode (Change to PIN lock mode), unlock with the PIN, and register the fingerprint again.
  • One known limitation: a device that reports a fingerprint enrolment but cannot complete biometric authentication leaves the app on the fingerprint screen. Switching to PIN mode is the way in.

While the lock is on

  • The app's screens are flagged secure, so the recent-apps preview shows no diary content.
  • The home-screen widget shows no diary list while the lock is on.
  • After you unlock, the app stays unlocked while you use it; the lock comes back when you leave and return.

What the app lock is and is not

The app lock is a barrier against someone who picks up your unlocked phone. The PIN is kept in the app's own private storage and compared locally, so it is not a defence against an attacker with root access or a forensic copy of the device. Treat it as a screen lock for the app, not as encryption of the data — that is what the next section is for.

2. Diary encryption (6-digit PIN)

Open an entry → ⋮ (top-right menu) → Encrypt diary

This encrypts the title and body of one entry with a 6-digit PIN you choose. You enter it twice; from then on the entry shows as encrypted until you enter the same PIN again.

  • Encrypt diary — enter a 6-digit PIN twice. The app stores the title and body encrypted, marks the entry as encrypted, and keeps a SHA-256 hash of the PIN so it can check later whether the PIN you type is the right one.
  • Decrypt diary — enter the PIN. From the decryption popup you can either decrypt the entry permanently (its title and body are stored in plain text again and the encrypted flag is cleared), or decrypt it once and only for reading (decrypt once, the first radio option) so it stays encrypted in storage.
  • Editing an encrypted entry, or exporting it to PDF, asks for the PIN again.
  • Attached photos are not encrypted. The files stay as they are, but while the entry is encrypted its photos cannot be viewed from the app.
  • The PIN cannot be recovered. The developer has no copy of it, and neither does the backup.

Why the encryption PIN is 6 digits, and what it is for

The 6-digit PIN is a deliberate design choice, not a leftover. Diary encryption in Easy Diary is meant to be one minimum layer of protection: if a backup file or the database ends up outside the phone, the entries should not be readable as plain text. It is explicitly not meant to resist a determined attacker who has the files and time to attack them.

That intent explains the numbers:

  • 6 digits is short enough to type on a keypad whenever you open an entry, which is what makes the feature usable at all; a long passphrase would push people to leave entries unencrypted.
  • One million combinations (10⁶) is far more than the 10,000 of a 4-digit lock, so casual reading is not possible, while the PIN stays a PIN.
  • The encryption is implemented with a standard Java library (Jasypt, password-based encryption), which is adequate for keeping plain text out of a leaked backup. If what you need is protection against someone who has your files and is willing to work on them, use a backup password on the archive (below) and keep the archive somewhere you control.

Entry encryption also survives a restore: a backup holds the encrypted title and body and the PIN hash, so an encrypted entry is still encrypted on the new phone, and the same 6-digit PIN opens it.

3. Backup passwords

Every backup path that writes an archive can take an optional password:

Where What the password protects Available since
Backup diary, Backup to external storage The database ZIP v1.4.357
[BETA] Backup full data The full archive v1.4.357
A backup schedule (internal, Google Drive, external folder) The archive the schedule writes v1.4.357
  • The archive is written as an AES-256 encrypted ZIP (zip4j). With no password it is an ordinary ZIP that anyone can open.
  • The file names and folder structure stay visible in an encrypted ZIP; only the data is encrypted.
  • The password cannot be recovered. Restoring asks for it before anything is opened. A wrong password lets you try again; cancelling leaves your data untouched.
  • A full backup and a scheduled external-folder backup produce the same archive, so a password set for one works for the other.

How a schedule keeps its password

A schedule has to run when nobody is there to type a password, so the app cannot simply ask. It stores the password sealed with a key that lives in the Android Keystore of that phone, in the form ks1:<iv>:<ciphertext> (AES-256-GCM, fixed associated data easy_diary.backupPassword). The plain password is never written to the database.

Consequences:

  • The sealed value only opens on the phone that sealed it. A backup restored on another phone, or after the Keystore was reset, brings a value nothing can open.
  • In that case the schedule skips the run, switches itself off, and posts a notification asking for the password again, rather than writing an unencrypted archive (v1.4.358 반영 예정).
  • Older app versions stored that password in plain text in the alarms table. Such a value is still read for compatibility and replaced the next time the schedule is edited.

4. Lock settings and backups

Lock settings and backups are deliberately kept apart:

  • The app's own backup leaves out the lock. Seven values — PIN enabled, PIN, pause timestamp, fingerprint enabled, the encrypted fingerprint key and its IV, and the fingerprint failure count — are excluded on purpose. Fingerprint material is bound to the device's Keystore anyway and cannot be restored elsewhere.
  • Android's own backup excludes them too, since v1.4.358. They live in their own file, aaf_lock_prefs.xml, which is excluded from both cloud backup and device-to-device transfer (v1.4.358 반영 예정). Before that version the PIN sat in the general preferences file and was carried along by Android 12+ backups.
  • A restored phone starts without an app lock (and, with an OS backup made before v1.4.358, with a PIN but no fingerprint lock). Set the lock again on the new phone — it takes a few seconds.

5. What Easy Diary does not do

  • It does not create an account for your diary, and it does not upload entries anywhere unless you back them up to Google Drive yourself.
  • It does not encrypt the database file itself. Protection of the data at rest rests on Android's own file-based encryption plus the optional per-entry encryption.
  • It does not keep a copy of your PINs or passwords, and it cannot reset them for you.

한국어로 보기 →

Clone this wiki locally