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

I need a function that will go through and encrypt all the strings

Enthusiast ,
Sep 29, 2008 Sep 29, 2008
I want to use one way enryption and need a function that will go through and encrypt all the strings in my password column in sql server 2003.

I also need a function that compares a test password string is equal to the hash value in the database. Can anyone give me some advice in this?
TOPICS
Database access
407
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
LEGEND ,
Sep 29, 2008 Sep 29, 2008
For the first question, it depends on the encryption algorithm you want to use. If it was cold fusion hash, a simple update query will do.

For the 2nd question, once again it's simple sql. Hash the test password sting so you are comparing one hashed value to another.
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
Enthusiast ,
Oct 06, 2008 Oct 06, 2008
Can you give me the update query that will hash the column please?
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
LEGEND ,
Oct 06, 2008 Oct 06, 2008
LATEST
Apparently it's not as simple as I thought. My first instinct was

update yourtable set password = '#hash(password)#'

but that will crash

This is inefficient, but you only have to do it once.

query1
select id, password thepassword
from yourtable

cfloop query="query1"

update yourtable
set password = '#hash(thepassword)#'
where id = #id#
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