Stashio
Feature

How Stashio encrypts your photos and files

Every file is encrypted on the phone before anything is written to storage, with well-tested building blocks and no home-made cryptography.

Updated 3 min readBy the Stashio team

Short answer

Stashio encrypts each photo, video and document with AES-256-GCM using Google’s Tink library, as it is imported and before anything reaches storage. The vault key is unlocked by your pattern, stretched with Argon2id and combined with a key held in the phone’s Android Keystore (StrongBox where available), so copied data can’t be attacked off the phone.

The short version

PartWhat Stashio uses
File encryptionAES-256-GCM, streaming, through Google Tink
Key from the patternArgon2id, 64 MiB of memory per attempt
Hardware bindingA non-exportable key in Android Keystore, in StrongBox when the phone has one
Recovery code26 characters, 128 random bits
Attempt limitAfter 5 mistakes: 30 s, 1, 5, 15, then 30 min
NetworkNone: the app has no INTERNET permission
Files in storageRandom names, sizes rounded to 64 KiB, every timestamp January 1, 2020

Encrypted before anything is written

When you import a photo, Stashio reads it and encrypts it in a stream, piece by piece, as it is written into the vault. There is never an unencrypted copy in the app’s storage or cache, not even for a moment. The same goes for thumbnails, for photos and videos taken with the built-in camera, and for the vault’s index of file names and folders.

AES-256-GCM is authenticated encryption: besides keeping the content secret, it detects any change. If even one byte of an encrypted file is altered, decryption fails instead of returning damaged or manipulated data. Videos use a streaming variant, so the player can jump to any point without decrypting the whole file first.

Where the keys come from

Each vault has its own random key. That key never leaves the phone unencrypted and is stored only wrapped, in one of four equal-sized slots. To unwrap it, Stashio needs your pattern:

  1. Argon2id turns the pattern into a long key. It needs 64 MiB of memory per attempt, which makes guessing expensive on any hardware.
  2. Android Keystore mixes in a key that lives in the phone’s secure hardware and can’t be exported. It only works while the phone is unlocked.
  3. The combined key unwraps the vault key. A wrong pattern unwraps nothing.

Step 2 is what protects copied data. Someone who copies the app’s files, through a backup tool or a forensic extraction, can’t try patterns on a computer: without your phone’s hardware key, there is nothing to test them against.

What storage reveals, and what it doesn’t

All encrypted files of all vaults sit in one folder. Their names are random, their sizes are rounded up to multiples of 64 KiB and every timestamp is set to January 1, 2020. You can’t tell which file is a photo and which a video, which vault a file belongs to, or when it was added. Android’s automatic cloud backup is turned off for the app, so nothing of the vault goes to your Google account through it.

Why no home-made cryptography

The most common way security apps fail is inventing their own encryption. Stashio deliberately uses only established, reviewed components: Google Tink for AES-256-GCM, Argon2id and HKDF from Bouncy Castle, and Android Keystore for the hardware key. The interesting work is in how they are combined, and that is described here and in the app’s about screen.

What encryption can’t do

  • Protect an open vault on a compromised phone. While you look at a photo, it is decrypted in memory. Malware with root access could read it at that moment.
  • Protect copies outside the vault. Stashio copies files in; the originals stay in your gallery and any cloud backup until you delete them. Exported copies are unencrypted too.
  • Recover a vault without the pattern and the recovery code. There is no back door, which also means no rescue.

Frequently asked questions

Is Stashio end-to-end encrypted?

There is no “end” other than your phone. Files are encrypted on the phone and never sent anywhere; backups you save are encrypted the same way and open only with the vault’s recovery code.

Can Stashio’s developers decrypt my files?

No. There is no account, no server and no copy of any key outside your phone. The app has no internet permission, so it can’t send anything even by mistake.

What is StrongBox?

A separate security chip in some Android phones, for example Pixel phones with the Titan M chip. When it is present, Stashio keeps its hardware key there; otherwise in the phone’s standard hardware-backed Keystore.

Does encryption make the app slow?

Opening a vault takes a fraction of a second longer because of Argon2id; that delay is the point. Browsing, zooming and playing videos are decrypted on the fly and feel like an ordinary gallery.

Keep your photos where only you can open them

Stashio encrypts photos, videos and documents on your phone. No account, no server, no internet permission.

Get it on Google Play

Free · Android 9 and later