I have some module, which using AES-128 encryption/decryption. And me necessary automatically generate one time in module secret key (if didnt initialized) for every user, after save and disallow to change. How can I do this?
If you really want to, you could generate a key and then hard-code the key value using hexadecimals. You could try and hide the value in the code, but it would amount to obfuscation, adding little to no security.
Genererate secret key for cryptography in module