Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: data encryption

Re: data encryption

From: Oliver Artelt <oli_at_md.transnet.de>
Date: Thu, 03 May 2001 05:41:38 -0700
Message-ID: <F001.002F8218.20010503043044@fatcity.com>

drop table emp;

create table emp(
EMPNO number primary key,

FIRSTNAME              VARCHAR2(30),
SURNAME              VARCHAR2(30),
PASSWORD              CHAR(32),
PHONE               VARCHAR2(32)

);

create or replace trigger emp_encryptpassword before insert or update of password on emp for each row
declare   

        b_in  raw(16) := UTL_RAW.CAST_TO_RAW(substr(:new.password, 1, 16));
        b_key raw(8)  := UTL_RAW.CAST_TO_RAW('EeTe32!!');
        b_out raw(32); 

begin

        dbms_obfuscation_toolkit.DESEncrypt(input =>b_in, key =>b_key, encrypted_data =>b_out);

        :new.password :=rawtohex(b_out);   

end;
/

insert into emp values(1,'BOB','SCOTT','Tiger',NULL);

Hi,
Play with that. Add error checking and decrypt with a function or encrypt the given password and compare the protected strings.

oli

-- 
Oliver Artelt
Oracle Certified DBA

cubeoffice GmbH & Co.KG # jordanstrasse 7 # 39112 magdeburg
telefon: +49 (0)391 6 11 28 10 # telefax: +49 (0)391 6 11 28 19
email: info@cubeoffice.de # web: http://www.cubeoffice.de



gy.andor_at_euromacc.hu wrote

> Hi Gurus !
>
> Is there any standard method to encrypt data? We are making an application
> that uses application-level privilege system, so we should store passwords
> for users. Of course we want to store encrypted passwords, but we don't
> know if is there an existing way for this or try develop own encryption.
> What do you suggest?
>
> Thanks in advance
> Gyula
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Oliver Artelt INET: oli_at_md.transnet.de Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Thu May 03 2001 - 07:41:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US