Forum Discussion
ukstin
Nimbostratus
Jan 29, 2009encrypt/decrypt URI
Hi,
I´m trying to do an Irule to encrypt and decrypt the URI with a cookie value as key. But it´s not working as expected, somebody as any opinion about these irule?
when HTTP_R...
Colin_Walker_12
Jan 29, 2009Historic F5 Account
First, it's always helpful if you give us more info to go off of than that something just isn't working as expected. Including details on HOW it's misbehaving, error log entries, etc. is very helpful.
That being said, it doesn't look like you're setting the value of decrypted anywhere. This would make it pretty hard to use that to update the uri later. Try changing the HTTP_REQUEST section to something like:
when HTTP_REQUEST {
set uri [HTTP::uri]
set host [HTTP::host]
if { [HTTP::cookie exists "JSESSIONID"] } {
set decrypted [AES::decrypt [HTTP::cookie value "JSESSIONID"] [b64decode $uri]]
if { [string length $decrypted] > 1 } {
log local0. "session: $IDkey uri $uri decriptada: $decrypted"
HTTP::uri $decrypted
set uri $decrypted
}
}
}
I think that'll get you closer to the result you're looking for. That's a pretty interesting use of a cookie as a key. I'd love to hear how it works out for you once you get it up and running.
Colin
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
