Forum Discussion
Harold_Deadman_
Nimbostratus
Apr 13, 2007AES decryption returning empty string
I am working on encrypting some cookies but I must be doing something wrong because I get empty strings when I decrypt the cookie. I have made the following example to demonstrate what I am seeing. Do...
Harold_Deadman_
Nimbostratus
Apr 13, 2007The problem appears to be that the encrypted value doesn't survive the base 64 encoding/decoding process. If I do this:
when RULE_INIT {
set ::key [AES::key 256]
set stringtoencrypt "Testing encryption"
set encrypted [AES::encrypt $::key $stringtoencrypt]
log local0. "Encrypted $encrypted"
set decrypted [AES::decrypt $::key $encrypted]
log local0. "Decrypted $decrypted"
}
then it works but if I am going to put an encrypted value in a cookie I would think it would need it to be encoded.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects