Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Where to set key to be used with Encrypt function

Participant ,
Oct 17, 2012 Oct 17, 2012

I'm about to use CF Encrypt function because I need to pass a var via url.

In order to use Encrypt () I need to create a KEY but I don't want to keep setting this key on the page where I need to use Encrypt()

Can anyone point me to the right direction on where is the best place to set this key so I can just refer to this key anytime I need it?

Can I do <cfset session.MyEncyprteKey = ....>? and everytime I need this key I just use #session.MyEncryptedKey# ?

I'm using CF8 and Application.cfc

TOPICS
Getting started
594
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2012 Oct 18, 2012
LATEST

I would have thought you would set the key per application, rather than per user session. For example, in onApplicationStart:

<cfset application.key = generateSecretKey("Blowfish")>

You would then refer each time to application.key.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources