encrypt Decrypt problem

Posted on 2005-04-27
Last Modified: 2013-12-20
We are using the encrypt and decrypt function with Coldfusion MX 6.1. We are using it to provide a basic level of security for customers using credit cards. When the customer passes the credit through a form, it gets checked for validity and then excrypted with the use of a key produced by us and written to a SQL database. During the decryption we get odd results, it seems that the AMerican Express cards are failing and we are receiving junk, instead of the decrypted version of the card number. We are also using the function preservesinglequotes to possible avoid problems with the entry into sql.

If anyone has any ideas on this issue. i would appreciate the input.

Question by:CJSantora
    1 Comment
    LVL 35

    Accepted Solution

    Well even with the preserve single quotes you could have problems with entry into SQL.

    Additionally there have been articles that state things like these quotes:

    "using ColdFusion's built-in functions is a good practice, but these methodologies fall a bit short when security is a real issue"

    "in the case of Cold Fusion encrypt(),the key is actually passed in both the encrypt() and decrypt() functions as plain text"

    "ColdFusion's encrypt() function can be decrypted, but the key must be passed in the code on the server, causing a security issue (plus encrypted data placed on the Web can be fairly easily cracked using any number of free tools available on the Internet."

    Here is a link:

    I recommend using a much more secure encryption if you are dealing with credit cards.

    I have used: CFX_ENCRYPT_AES


    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    A web service ( is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
    Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
    The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and Log…
    The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now