1
0
Fork 0
mirror of https://github.com/HACKERALERT/Picocrypt.git synced 2024-12-30 19:32:33 +00:00
Picocrypt/Internals.md

24 lines
1.9 KiB
Markdown
Raw Normal View History

2021-05-30 18:50:03 +00:00
# Internals
2021-08-07 22:05:38 +00:00
If you're wondering about how Picocrypt handles cryptography, you've come to the right place! This page contains the technical details about the cryptographic algorithms and parameters used. This page does not go in-depth, as you can just review the source (there's only one file) to understand the nitty-gritty details.
2021-05-30 18:50:03 +00:00
# Core Cryptography
2021-08-07 22:05:38 +00:00
Picocrypt uses the following cryptographic primitives:
2021-11-20 04:52:13 +00:00
- XChaCha20 (cascaded with Serpent in CTR mode for paranoid mode)
- Keyed-BLAKE2b for normal mode, HMAC-SHA3 for paranoid mode (256-bit key, 512-bit digest)
- HKDF-SHA3 for deriving a subkey used with the MAC above, as well as a key for Serpent
2021-09-04 23:05:17 +00:00
- Argon2id:
- Normal mode: 4 passes, 1 GiB memory, 4 threads
- Paranoid mode: 8 passes, 1 GiB memory, 8 threads
2021-05-30 18:50:03 +00:00
2021-08-13 15:59:04 +00:00
All primitives used are from the well-known golang.org/x/crypto module.
2021-09-04 23:05:17 +00:00
# Keyfile Design
Picocrypt allows the use of keyfiles as an additional (or only) form of authentication. Picocrypt's unique "Require correct order" feature enforces the user to drop keyfiles into the window in the exact same order as he/she did when encrypting, in order to decrypt the volume successfully. Here's how it works:
If "Require correct order" is not checked, Picocrypt will take the SHA3 hash of each file individually, and XORs the hashes together. Finally, the result is XORed to the master key. Because the XOR operation is both commutative and associative, the order in which the keyfiles hashes are XORed to each other doesn't matter -- the end result is the same.
2021-11-20 04:52:13 +00:00
If "Require correct order" is checked, Picocrypt will combine (concatenate) the files together in the order they were dropped into the window, and take the SHA3 hash of the combined keyfiles. If the order is not correct, the keyfiles, when appended to each other, will result in a different file, and therefore a different hash. Thus, the correct order of keyfiles is required to successfully decrypt the volume.
# Header Format
Work in progress...