Encrypt a file (.s3enc)
crypto_file_encryptEncrypt any file with a password into the .s3enc format using chunked AES-256-GCM and PBKDF2-SHA256, preserving encrypted metadata and detecting tampering.
Instructions
Encrypt any file with a password into the website's .s3enc format: chunked AES-256-GCM, key from PBKDF2-SHA256 (600,000 rounds, random salt), original name/type/size stored encrypted inside, tamper/truncation/reorder-proof. Files made here open at https://s3eidat.github.io/file-encrypt/ and vice versa (crypto_file_decrypt). Whole file is processed in memory (size limit = server --max-mb). Web version: https://s3eidat.github.io/file-encrypt/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | The file to encrypt: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI). | |
| name | No | File name to store inside (restored on decrypt). Default: the input file name. | |
| output | No | Where to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set). | |
| mimeType | No | MIME type to store. Default: guessed from the extension like a browser would ("" if unknown). | |
| password | Yes | The password. Normalised to Unicode NFC first, like the website. | |
| chunkSize | No | Chunk size in bytes (website: 4 MiB). | |
| iterations | No | PBKDF2 rounds (website: 600,000). | |
| returnBase64 | No | Also return the output as base64 in the result (only for small files). Default false. |