Forum Discussion
Kevin_Stewart
Mar 14, 2008Employee
AES functions
Hello Devcentral gurus,
Does anyone know the specifics of the AES functions and how they work. Specifically, look at the following code snippet:
set testkey "test"
set testdat...
kuhn_52743
Sep 23, 2009Nimbostratus
Hi spark,
OK I'll look forward to any info you may be able to publish in the future.
In the meantime, I'm trying to figure some of it out the hard way, and get very strange results. Maybe I have some basic misunderstanding. Please consider this snippet of an irule - all I'm trying to do is generate a 128 bit key, then verify the length of the key is 128 bits, and print the key value out in hex:
set ::secret_key [AES::key 128]
log local0. " of chars of key is [string length $::secret_key]"
log local0. " byte Length of key is [string bytelength $::secret_key]"
set ::numconversions [binary scan $::secret_key H* ::keyhex]
log local0. "Key value in hex: $::keyhex ([string length $::keyhex])"
This results in the following output in the log:
Sep 23 17:58:50 tmm1 tmm1[2149]: Rule : of chars of key is 40
Sep 23 17:58:50 tmm1 tmm1[2149]: Rule : byte Length of key is 40
Sep 23 17:58:50 tmm1 tmm1[2149]: Rule : Key value in hex: 41455320313238206665623932383734373661666330326639353264636235346139386234386231 (80)
This seems totally wrong - I ask for a 128 bit key, and I get something 40 bytes long? The "hex" output is 80 hex characters, which would be equivalent to 40 bytes also. But non of the characters are a,b,c,d,e, or f - all of them are 0-9.
Any idea what's going on here? I'm either totally confused, or the key is not stored in a straightforward way?
Thanks,
Scott
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