How to encrypt a field? [keeping same length]
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to encrypt a field? [keeping same length]

  1. #1
    Join Date
    Nov 2003
    Posts
    37

    How to encrypt a field? [keeping same length]

    I want to encrypt a field in a table (it contains credit card number).
    I tried to do it using dbms_obfuscation_toolkit, but the problem is encrypted string becomes much larger in length compared to actual field length (16 characters).

    How can I encrypt the field to keep it same length yet hard to break?

    Thanks a lot in advance.

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    I've a sneeking suspicion that it might be impossible - in some na´ve way I expect the encrypted string to hold more information than the plain text - it includes some knowledge about the password too - so it must be longer. Is anyone out there up on information theory?

    Vague ideas for solving your problem:
    - map your number onto a shorter text string: two digits could map into one character using CHR(nn). How big is a CHAR(8) when encrypted?
    - can you avoid encrypting the first x digits? AFAIK, they only indicate the card type (VISA, AmEx etc).
    - what are the possibilties for encrypting it as an integer rather than text?

  3. #3
    Join Date
    Nov 2003
    Posts
    37
    Thanks.

    No, I can't discard some fields. It can store either 16 or 18 digits in the field. Also, encrypting it to an integer is difficult. Oracle's obfuscation toolkit is a standard package. Now, if I use any logic of my own the client may not approve it!

  4. #4
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,443

    Cool

    Originally posted by sbasak1
    Thanks.

    No, I can't discard some fields. It can store either 16 or 18 digits in the field. Also, encrypting it to an integer is difficult. Oracle's obfuscation toolkit is a standard package. Now, if I use any logic of my own the client may not approve it!
    What DaPI means is to convert the credit card number to integer (or packed decimal) before encrypting.

    Also, to hold encrypted data may require use of a RAW type column. Varchar2 may be used, but you may experience problems with NLS/character conversion when exp/imp data or copying data to another DB.

    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

Posting Permissions

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



Click Here to Expand Forum to Full Width