Coldfusion encryption string longer than unecrypted string

Posted on 2009-04-20
Last Modified: 2013-12-24
I am using Coldfusion's default encrypt() function to encrypt an existing string in a database that is 11 characters long.  The encrypted string is 18 characters which is longer than the database field.  Do I need to make my database field bigger to accomodate this or is there a way to restrict the length of encrypted fields?
Question by:steveweems
    LVL 19

    Expert Comment

    check your database to make it will allow longer characters
    LVL 16

    Accepted Solution

    You'll either need to add a new column to your table that is longer, or increase the length of the existing column.

    Author Comment

    The database is Oracle and I can re-engineer the table to accept longer characters.  I am a little reluctant to do so as the table is has been in use for some time, there may be several dependencies within the database which may need to be addressed.

    I was wondering if there is an alternative by using an encrypt function that had some control on the number of characters output.

    LVL 16

    Expert Comment

    Not that I'm aware of.  The encrypt function takes an optional parameter for the encryption algorithm.  There are many, they are listed here.

    Without knowing more about how those work, I couldn't say if any of them will encrypt a string of N-length and return an encrypted string also of N-length.  I doubt it though.

    The only other solution would be to do something like Rot13 where you substitute each letter for another character.  This isn't the same as encryption, and isn't secure.  

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now