Title:
encrypt() key passed as a string vs. as a variable renders a different result
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aleksey Ivanov / Aleksey Ivanov (midimaxi)
Created: 10/22/2014
Components: Language
Versions: 9.0.1
Failure Type:
Found In Build/Fixed In Build: 9.0.1 / CF11 Update5
Priority/Frequency: Major / All users will encounter
Locale/System: English / Windows 7
Vote Count: 0
Problem Description:when passing a secret to encrypt() function as a variable, the encrypted string changes on every request.
Steps to Reproduce:
<cfset secretKey = "Hq/WFySQfzQsO0mp2ixJDA==" />
<cfset encStr = encrypt("someText", secretKey,"AES/CBC/PKCS5Padding","hex") >
<cfset decStr = decrypt(encStr, secretKey, "AES/CBC/PKCS5Padding","hex") >
<cfoutput>#encStr#</cfoutput>
<cfoutput>#decStr#</cfoutput>
vs.
<cfset encStr = encrypt("someText", "Hq/WFySQfzQsO0mp2ixJDA==","AES/CBC/PKCS5Padding","hex") >
<cfset decStr = decrypt(encStr, "Hq/WFySQfzQsO0mp2ixJDA==", "AES/CBC/PKCS5Padding","hex") >
<cfoutput>#encStr#</cfoutput>
<cfoutput>#decStr#</cfoutput>
Actual Result: When key is passed as a variable, encrypted string changes on every request. When key is explicitly provided, encrypted string does not change.
Expected Result:
Any Workarounds:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3842326
External Customer Info:
External Company:
External Customer Name: midimaxi
External Customer Email:
External Test Config: My Hardware and Environment details: Windows 7, IIS7, CF9.0.1
Attachments:
Comments: