I have a form on a website that takes in some personal information from the visitor. I\'m passing this information to another service and I need to assign each one of these for
If you use a Cipher you can encrypt an always different message to get an always different key:
def encrypt(data, key, cipher_type)
aes = OpenSSL::Cipher::Cipher.new(cipher_type)
aes.encrypt
aes.key = key
aes.update(data) + aes.final
end
>> Base64.encode64(encrypt(Time.now.to_s, "some_key_long_enough_for_the_job", "AES-256-ECB"))
=> "sKJU3qhszV30Ya9vMFvbqIXus+QygICdDyr7UQFWLeM=\n"