Home » RDBMS Server » Server Administration » Storage In Hexadecimal Format In Database
Storage In Hexadecimal Format In Database [message #372506] Fri, 16 February 2001 07:12 Go to next message
Srinivasulu P
Messages: 5
Registered: December 2000
Junior Member
Hai Friends,
I have One Problem that i want to store my data in very confidential mode , like our oracle database user passwords are storing , so that even DBA or Some Of my client user can't access the data by using SQL editor, like any oracle datatype are suporting this type or any concept where we can build this type of functinality ( With out writing our own code ). if u have or related information please send asap .

Thank U
Regards
Srinivasulu P ( Lanco Global )
Re: Storage In Hexadecimal Format In Database [message #372510 is a reply to message #372506] Fri, 16 February 2001 12:12 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
-- http://www.oracle.com/oramag/code/cod11226.html

create or replace FUNCTION Xorbin(c1 CHAR,c2 CHAR) RETURN CHAR IS
loop1 NUMBER;
loop11 NUMBER;
r1 VARCHAR2(8);
r2 VARCHAR2(8);
r3 NUMBER;
result VARCHAR2(40);
divis NUMBER;
BEGIN
result := '';
FOR loop1 IN 1..LENGTH(c1) LOOP
r1 := Convbin(SUBSTR(c1,loop1,1));
r2 := Convbin(SUBSTR(c2,loop1,1));
divis := 128;
r3 := 0;
FOR loop11 IN 1..8 LOOP
IF TO_NUMBER(SUBSTR(r1,loop11,1))+TO_NUMBER(SUBSTR(r2,loop11,1))=1 THEN
r3 := r3 + divis;
END IF;
divis := divis / 2;
END LOOP;
result := result || CHR(r3);
END LOOP;
RETURN(result);
END;
/

create or replace FUNCTION Convbin(c1 CHAR) RETURN CHAR IS
loop1 NUMBER;
value NUMBER;
divis NUMBER;
r1 VARCHAR2(30);
-- encryption encrypt crypt unencrypt in Oracle

BEGIN
r1 := '';
value := ASCII(c1);
divis := 128;
FOR loop1 IN 0..7 LOOP
IF TRUNC(value/divis) = 1 THEN
r1 := r1 || '1';
ELSE
r1 := r1 || '0';
END IF;
value := value MOD divis;
divis := divis / 2;
END LOOP;
RETURN r1;
END;
/

-- SET serveroutput ON
-- DECLARE
-- result VARCHAR2(30);
-- mask VARCHAR2(30);
-- BEGIN
-- mask := 'abc'; /* Must be greater or equal to the value that
-- will be "Crypted" */
--
-- result := XORBIN('ABD',mask); /* "Crypt" */
-- dbms_output.put_line(result);
--
-- result := XORBIN(result,mask); /* "Unencrypt" */
-- dbms_output.put_line(result);
--
-- END;
-- /
Previous Topic: Re: dispaly the COLUMNS and data on Tablar style.
Next Topic: help required in optimizing a query
Goto Forum:
  


Current Time: Mon Dec 23 01:26:32 CST 2024