Encrypt returning strange results

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Encrypt returning strange results

    I am using encrypt to hide user passwords while in a mysql database (stored in
    a text field although I have also tried varchar). It seems to work fine but
    there are some exceptions. I am using the following code -

    Encryption before entry to the database

    <cfset Encrypted = Encrypt(trim(form.password), Request.PasswordKey)>
    <cfset form.password = #Encrypted#>

    Decryption

    #Decrypt(get_customer.password,Request.PasswordKey )#

    I get a problem with password strings that have 5 or 8 characters and end in
    the letter t. When decrypted the string reads ok except for the last character
    which is replaced with {.

    eg trust = trus{

    I have changed the seed (passwordkey string) and this solves the current
    problem. But my problem now is that this was only found after numerous entries
    into the database, so changing the seed will mean I have to re enter all the
    passwords (something I would like to avoid). I'm not really sure if this is
    even worth doing as I may find that I get a similar problem on different
    string. The documentation states that the seed parameter 'Can be any
    combination of any number of characters' , so I am unsure why I am getting this
    problem.

    Any help on what is causing this problem or how to solve it would be greatly
    appreciated.

    Adrian

    hoddle10 Guest

  2. Similar Questions and Discussions

    1. Recordset returning inconsistent results
      I am developing a php site using mysql and apache. I have finally managed to get a database connection and am trying now to create some...
    2. SQL Query Not Returning Correct Results
      I am trying to pull all records that are set for mailing and are from every state except for Nebraska and some counties in Iowa. It isn't pulling...
    3. Verity - cfsearch not returning results on subsequentgets
      We have no problem returning results from searches with CF server 5. We are now moving to CF Server MX. With an initial search, the result set is...
    4. returning results in rows
      I have a db with the fields Day, Month, Year and Message. How can I select all of the messages for the current week starting with sunday and return...
    5. Returning results where the match is not always there!!!
      Hi All I have two tables that I need to match customer data on. The first table holds all of the customers billing info Title Name Address...
  3. #2

    Default Re: Encrypt returning strange results

    What version of CF are you using? As for the seed are you using the same seed
    to decrypt as you encrypted? Also seeds generally expect a specific length
    based on the algorithim. If you are not using CFMX 7 I dont think you have to
    worry about that though. Can you create a new seed value and key and replicate
    the issue and post the code, the seed value, adn the key?

    niko1 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139