SimpleEncryption
SimpleEncryption copied to clipboard
Simple Encryption for PHP
Consider generating a random salt every time you encrypt data. That way, you can use HKDF to derive a new cipherkey, mackey and iv from the master key. Then, just...
Currently, the produced encrypted output includes only the IV, MAC and Ciphertext. Consider adding a leading byte (packed) which indicates an algorithm version indicator. This will allow upgrades to the...
Audit
I'm pretty confident in the code so far, but obviously, as a cryptographic library it needs more eyeballs. Two notable pieces of code that could be a concern: - [HKDF...
I **strongly** recommend that you make the class stateless rather than statefull as you have it now. Basically, don't pass in input to the constructor, but instead have discrete `encrypt($text)`...
Key rotation is a significant concern that no PHP library really deals with. Consider adding support for key rotation (possibly with a "key identifier"). This is something I was playing...