TegoSafe
EN

How TegoSafe protects your documents.

The keys, where they live, who could get in and what would stop them. Including the cases where nothing would.

  • Not independently audited
  • Last checked against the format spec:

The short version

TegoSafe encrypts each document on your iPhone with AES-256-GCM. The key is made on the phone and is never stored or sent in the open. There is no TegoSafe account and no TegoSafe server, and the app has no analytics or crash reporting of its own. The only thing that can leave the phone is an optional backup of the encrypted files, to your own iCloud. That backup holds the key only in wrapped forms: wrapped by your recovery card, and by a passcode that is useless without the device secret, which is never in a backup.

This page describes how TegoSafe works, taken from the app's written vault format. It has not been independently audited.

What is in the app

What TegoSafe has, and what it does not have.

PartState
Scan, review and locking documentsIn the app.
Passcode, Face ID and the recovery cardIn the app.
Folders, document details, expiry reminders, searchIn the app.
Backup and restoreIn the app. Optional, to your own iCloud.
The SafeIn the app.
PurchasesIn the app, through the App Store.
Clean copy and sealed sendingIn the app.
Free decryptorPlanned.
Independent auditNone.

What happens when you lock a document

  1. The app makes a random 256-bit master key for your vault, once, on the phone.
  2. The photo or file is encrypted with that key using AES-256-GCM, with a fresh random nonce for every file.
  3. The encrypted file is saved under a random name. The document's name, kind, dates and expiry go into an index that is encrypted with the same key.
  4. The master key itself is never stored in the open. It is wrapped by your passcode and, separately, by your recovery card.

Documents are shown from memory only, and when the app locks, the keys and every decoded picture are dropped. The app locks as soon as it leaves the screen and covers itself in the app switcher.

The keys

KeyWhat it isWhat it opens
Passcode6 digits, stretched with PBKDF2-HMAC-SHA256 (600,000 rounds), then mixed with the device secret using HKDF-SHA256Documents, on this iPhone only
Device secret32 random bytes kept in the iPhone Keychain, readable only while the phone is unlocked. It is never in a backup and never leaves the deviceNothing by itself. It makes the passcode useless anywhere else
Face IDA copy of the Documents key in the Keychain behind Face ID. Adding a new face to the phone makes it unusableDocuments, on this iPhone only
Recovery card256 random bits, shown as 13 groups of four characters that you print or write downDocuments, on any phone, from the vault or a backup
Safe pattern or passphraseA pattern on a 5 by 5 grid (at least 7 cells) or a passphrase, stretched with at least 1,000,000 rounds and mixed with the device secretThe Safe, on this iPhone only
Safe code128 random bits, shown as 12 words or 48 digits that you write downThe Safe, on any phone. There is no other reset

The recovery card never opens the Safe, and the Safe code never opens Documents.

Wrong tries are slowed down

The count is kept in the Keychain on the phone. The waits run on the phone's uptime, so changing the date does nothing, and a restart starts the wait again. The Safe never wipes itself.

Wrong tries in a rowDocumentsThe Safe
1 to 4No waitNo wait
530 seconds30 seconds
61 minute5 minutes
75 minutes1 hour
815 minutes4 hours
9 and more1 hour24 hours

Who could get in, and what stops them

Four cases, each with what holds and what does not.

Someone gets a copy of your backup

Holds
Every document, name and date is encrypted. The passcode and the Safe pattern are useless without the device secret, which is never in a backup. Documents opens only with the recovery card and the Safe only with the Safe code. Both are long random keys made on the phone, not something a person chose.
Does not hold
They can see how many files there are, their sizes and dates, and that a Safe exists. Whoever also has your recovery card opens Documents. An older copy of your backup still holds what was in Documents then, including documents you later deleted or moved to the Safe.

Someone takes your phone while it is locked

Holds
While the phone is locked, iOS keeps the vault files and the device secret unreadable, even to TegoSafe. Face ID in TegoSafe needs your face. This relies on iOS data protection.
Does not hold
This rests on the phone's own lock. A thief who learns or breaks its passcode is in the next case.

Someone has your unlocked phone, or knows its passcode

Holds
TegoSafe still asks for its own passcode, and wrong tries meet the waits above. A new face added to the phone does not open TegoSafe. A long Safe passphrase is designed to stay closed even here.
Does not hold
With tools that read the app's files and the device secret off the phone, they can guess on a computer, where no waits apply. A 6-digit passcode falls to that in hours or less. A 7-dot pattern also falls, more slowly. A passphrase of several random words does not. And if TegoSafe is open when the phone is taken, they see what is open until the app locks.

You are forced to unlock it

Holds
A second pattern can open a harmless Safe instead of yours. The Safe tab looks the same on every iPhone, with or without a Safe.
Does not hold
Whoever forces the unlock sees what you open, and everything in Documents. Nothing in TegoSafe makes Documents look empty.

Your original photos

Locking a document does not delete the original from Photos, or from iCloud Photos if that is on. Until you remove it, the original is as exposed as it was before. TegoSafe offers to remove originals only after a backup exists and your recovery card has passed a check, and you decide each time.

What you must keep

  • Your recovery card. Without it, a forgotten passcode or a lost phone means Documents cannot be opened. Keep it somewhere the phone is not: anyone with the card and a backup can open Documents.
  • Your Safe code. The Safe has no reset. Lose the pattern or passphrase and the Safe code, and nobody can open the Safe, including us.

An open format

The vault format is a written spec with test vectors, not a by-product of the app's code. It is the format TegoSafe ships with. It uses only standard algorithms (AES-256-GCM, PBKDF2-HMAC-SHA256 and HKDF-SHA256) from Apple's own libraries, and no custom cryptography. A free decryptor built from the spec is planned, so your files never depend on this app.

Report a security issue

If you find a weakness, write to [email protected] with the word Security in the subject. Please do not include anyone's real documents.