Encrypt
What is encryption?
Encryption uses a passphrase to transform the original data into an encrypted form intended to be inaccessible without the appropriate key. MapSafe uses the encryption facility provided by the Web Crypto API built into the browser. A 15 term passphrase is randomly generated and used to encrypt the masked dataset which is later required to recover the original data. The masked dataset is encrypted in the browser memory at three levels.
Browser encryption implementation
The current source uses Web Crypto, PBKDF2 with SHA-256, and AES-GCM with a 256-bit key to encrypt the packaged data. AES-GCM provides confidentiality and an authentication check for encrypted content; it does not supply a digital signature identifying the data owner.
The source currently uses 10,000 PBKDF2 iterations and an eight-byte random salt. These describe the existing research implementation, not a recommendation for a new design. Key derivation, passphrase entropy and the application environment require separate security assessment.
Encryption levels
- The full 15 term passphrase is used to encrypt the original dataset,
- 10 terms of the full passphrase to encrypt the masked dataset, and
- 5 terms of the full passphrase to encrypt the `more' masked dataset.
These passphrases are required to later decrypt to each of the three levels.
How nested encryption works
The fine-level archive contains the original zipped shapefile. If the medium level is included, its archive contains the derived representation, metadata and the encrypted fine-level archive. If the coarse level is also included, its archive contains the coarser representation, metadata and the encrypted medium-level archive. Each included layer is encrypted with the corresponding passphrase prefix.
| Level | Representation | Passphrase |
|---|---|---|
| Fine (1) | Original dataset | All 15 terms |
| Medium (2) | Masked or binned dataset | First 10 terms |
| Coarse (3) | Further-masked or binned dataset | First 5 terms |
The medium passphrase uses the first ten terms of the full passphrase; coarse uses the first five. A recipient given a longer prefix also knows the shorter prefixes. The scheme is hierarchical, not an independent account or public-key recipient system.
Encryption and decryption process
A detailed description of the encryption and decryption processes are provided in this image.
Multiple levels of spatial detail
The obfuscation (masking and hexabinning) and encryption are carried out at multiple levels:
What is in the encrypted volume?
The original and masked point representations are packaged as zipped shapefiles. Binned representations are stored as GeoJSON in the corresponding archives. The source also includes metadata describing the protection levels and parameters. The final outer encrypted volume is downloaded with an .enc suffix.
The selected representations travel together, but knowing a coarse passphrase does not itself provide the longer terms needed to recover finer levels. This design assumes that passphrase generation, derivation and handling provide adequate protection; that assumption requires assessment in the current implementation.
Generate a passphrase
Select Generate passphrase for encryption. Store the generated passphrase securely. Share only the terms required for the intended access level.
Choose the levels to include
Select Fine to include only the original dataset, Add medium to include a masked representation as well, or All Three to include the further-masked or binned representation. Select Encrypt and Download Dataset to save the encrypted volume.
Save and handle the encrypted release
- Generate a fresh passphrase for the intended non-sensitive evaluation or approved release.
- Select Fine, Add medium or All Three according to the needed representations.
- Select Encrypt and Download Dataset and retain the encrypted output intact.
- Keep the passphrase private, retaining terms in their exact order. Share only the appropriate prefix through a secure channel.
- Test recovery and, if required, proceed to Notarise.
An unencrypted masked or binned download is not the same as the encrypted volume. Treat any exported representation according to its remaining disclosure risk. Changing a recipient's role does not revoke a passphrase or file that they already hold.
