I'm writing a simple encryption/decryption library which has the following requirements:
- For key derivation functions, support:
- $SHA256 \rightarrow bcrypt$ (since $bcrypt$ limits input passphrase length, hash it using SHA-256 first, then feed output of SHA-256 into bcrypt)
- For key derivation functions, allow custom iteration count.
- For encryption/decryption support:
- Triple DES
- Authenticity using HMAC+SHA256 every $n$ bytes
Since I'm potentially using multiple different symmetric key algorithms for encryption and decryption, I have the following problems:
- How do I deal with different output sizes from my KDFs?
- How do I deal with different key input requirements from my symmetric key algorithms?