Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2012
    Posts
    25

    Unanswered: Oracle column level decryption

    Dear,

    I am totally new in this encryption/decryption method. Recently one of my client insert some data using any kind of encryption mechanism and shared with me a key and padding character. Now I need to decrypt the column message for further proceess.

    additional info, Database is in my end. and I gave only insert permission in one column. Data type of this column is Raw. My client Shared below info with me

    Decryption Key := 21022014
    Padding character := '~';

    Please help me!!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Recently one of my client insert some data using any kind of encryption mechanism
    I suspect that you should use the kind of decryption mechanism appropriate for the encryption mechanism used; what ever that may be.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Dec 2012
    Posts
    25
    So, there is nothing i can do with those information they shared with me unless i know the encryption mechanism??

    It is quite tough for me as co-operation meter is pretty low from their side.

    Any way thanks a lot....!!

  4. #4
    Join Date
    Dec 2012
    Posts
    25
    Decryption can be done by those information my client provided me. Not necessary to know the encryption method. Need to create package for encryption and decryption and in the package body need to mention the decryption key and padding character.

    Regards,

    rush

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by rush View Post
    Decryption can be done by those information my client provided me. Not necessary to know the encryption method. Need to create package for encryption and decryption and in the package body need to mention the decryption key and padding character.

    Regards,

    rush
    Without knowing the encryption method, I don't believe that there is any way to reverse the encryption to regain the unencrypted content.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #6
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Rush,
    Are you perhaps trying to get at that your client is requesting their data to be encrypted within your database and that they want to use that key and pad when accessing their data?
    Dave

  7. #7
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Have you tried using the DBMS_OBFUSCATION_TOOLKIT or DBMS_CRYPTO packages?
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  8. #8
    Join Date
    Dec 2012
    Posts
    25
    Quote Originally Posted by Pat Phelan View Post
    Without knowing the encryption method, I don't believe that there is any way to reverse the encryption to regain the unencrypted content.

    -PatP
    I am not arguing with you guys as I am totally new about encryption/decryption. Therefore, In my case I think I am totally lucky. I googled and found a solution which worked for me..

    Regards,

    rush
    Last edited by rush; 04-02-14 at 01:50.

  9. #9
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by rush View Post
    . . . I think I am totally lucky. I googled and found a solution which worked for me..
    And that solution is...?
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  10. #10
    Join Date
    Dec 2012
    Posts
    25
    Quote Originally Posted by LKBrwn_DBA View Post
    And that solution is...?
    Code:
    CREATE OR REPLACE PACKAGE my_package_name AS
      FUNCTION decrypt (p_raw  IN  RAW) RETURN VARCHAR2;
    END my_package_name;
    /
    
    
    CREATE OR REPLACE PACKAGE BODY my_package_name AS
    
      g_key  RAW(1000) := UTL_RAW.cast_to_raw('21022014');
      g_pad_chr VARCHAR2(1) := '~';
      
      PROCEDURE padstring (p_text  IN OUT  VARCHAR2);
      
      FUNCTION decrypt (p_raw  IN  RAW) RETURN VARCHAR2 IS
          l_decrypted  VARCHAR2(32767);
      BEGIN
        DBMS_OBFUSCATION_TOOLKIT.desdecrypt(input => p_raw,
                                            key   => g_key,
                                            decrypted_data => l_decrypted);
                                            
        RETURN RTrim(UTL_RAW.cast_to_varchar2(l_decrypted), g_pad_chr);
      END;
      PROCEDURE padstring (p_text  IN OUT  VARCHAR2) IS
         l_units  NUMBER;
      BEGIN
        IF LENGTH(p_text) MOD 8 > 0 THEN
          l_units := TRUNC(LENGTH(p_text)/8) + 1;
          p_text  := RPAD(p_text, l_units * 8, g_pad_chr);
        END IF;
      END;
     
    END my_package_name;
    /
    this is the code I used though I am not clear about all the parameters. But fortunately it worked for me.

    Please share If you have any other suggestions.

    regards,

    rush

  11. #11
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by rush View Post
    [code]
    . . . E t c . . .
    this is the code I used though I am not clear about all the parameters. But fortunately it worked for me.

    Please share If you have any other suggestions.

    regards,

    rush
    No other suggestions, I knew it was either DBMS_OBFUSCATION or DBMS_CRYPTO.
    Congrats...You got it right!
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  12. #12
    Join Date
    Dec 2012
    Posts
    25
    Quote Originally Posted by LKBrwn_DBA View Post
    No other suggestions, I knew it was either DBMS_OBFUSCATION or DBMS_CRYPTO.
    Congrats...You got it right!
    Thanks a lot LKBrwn_DBA ... !! I really appreciate your surpport ...


    regards,

    rush

Posting Permissions

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