Solved

Encrypting more than 8 bytes with Crypt::DES for Oracle decryption

Posted on 2004-10-21
467 Views
Last Modified: 2008-03-10
I'm trying to encrypt data using Crypt::DES in perl which will then be inserted to an Oracle8i database using the DBMS_OBFUSCATION_TOOLKIT to decrypt it.  Some of this data is more than 8 bytes long, so my first instinct was to break the string up into 8 byte segments and concatenate the results together, and then do the same in a PL/SQL function calling the obfuscation tooolkit.  Unfortunately, this returns gibberish.  Any suggestions?
0
Question by:rotor89
    8 Comments
     
    LVL 48

    Expert Comment

    by:Tintin
    How much data do you want to encrypt?

    Does DBMS_OBFUSCATION_TOOLKIT only support DES?
    0
     
    LVL 84

    Expert Comment

    by:ozo
    Could you use Crypt::CBC to cypher block chain the DES blocks for an arbitrary size string?
    0
     
    LVL 19

    Expert Comment

    by:teraplane
    This module will do all the blocking for you. If you install it, it will require the Crypt::CBC and Crypt::DES modules to also be installed. You can encrypt data from either a string or file. but can only decrypt from a file.

     use Crypt::CBCeasy;

     DES::encipher($my_key, "plain-file", "crypted-file");
     $plain_text = DES::decipher($my_key, \*CRYPTED_FILE_HANDLE);
    0
     

    Author Comment

    by:rotor89
    The version of DBMS_OBFUSCATION_TOOLKIT that comes with Oracle 8i does seem to only support DES.  The data I'm encrypting ranges up to 30 or so characters.

    After posting this yesterday I stumbled across Crypt::CBC, but that didn't work either.  It seems to use a different method to chain the blocks than Oracle does.
    0
     
    LVL 84

    Expert Comment

    by:ozo
    What method does Oracle use?
    0
     

    Author Comment

    by:rotor89
    "What method does Oracle use?"

    And there's the real issue - it's a binary package and I can't find any documentation that explains this.  Since 8 byte strings work fine on their own, I figured that breaking it down into separate 8 byte strings and concatenating would do the trick, but it doesn't.

    Thanks
    0
     

    Author Comment

    by:rotor89
    Well, I had to find an interim method to please people for now, so this isn't such a hot topic for me at the moment, but I'll leave this open as I will have to come back to it later.  My hope is that we'll be moving to Oracle 9i or 10g where newer encryption methods are available.  Still, if anyone has a suggestion - I know I wouldn't get complaints if I were able to impliment this.
    Thanks.
    0
     

    Accepted Solution

    by:
    jmcg - sounds good to me.

    Thanks.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles al…

    933 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

    17 Experts available now in Live!

    Get 1:1 Help Now