I want to end-to-end encrypt items in a stateless environment. These items have an identifier (random string). Now I want to add encryption by adding a random key. The URL could be
https://server.tld/item#key which users can share with each other.
I want to only use Web Crypto API (
SubtleCrypto) without any additional libraries.
My idea so far:
- Generate random key:
- Base64 encode/decode for URI fragment:
- Create key object:
- Encrypt/Decrypt using AES-CBC:
Is it a good idea to use the first 16 bytes of SHA-1 (20 bytes long) as IV?