PassWord encryption and decryption [message #18656] |
Sat, 09 February 2002 03:06  |
Abdullah Gilani
Messages: 18 Registered: October 2001
|
Junior Member |
|
|
hi all Oracle8i Rel-2 and onwards users,
for password encryption and decryption Oracle 8i Provide built-in Package "DBMS_OBFUSCATION_TOOLKIT"
you may use DBMS_OBFUSCATION_TOOLKIT package.
DBMS_OBFUSCATION_TOOLKIT works only from Oracle realease 8.1.6 onwards
OR
you may use following Procedure....input 8 or multiple of 8 (6,16,24......)...
following procedure encrypted into hex value...like 'agilani ' where agilani plus one space is the password...try and enjoy
DECLARE
input_string VARCHAR2(16) := 'agilani ';
key_string VARCHAR2(8) := 'scottsc ';
encrypted_string VARCHAR2(2048);
decrypted_string VARCHAR2(2048);
begin
dbms_obfuscation_toolkit.DESEncrypt(
input_string => input_string,
key_string => key_string,
encrypted_string => encrypted_string );
dbms_output.put_line('> encrypted hex value : ' ||
rawtohex(UTL_RAW.CAST_TO_RAW(encrypted_string)));
dbms_obfuscation_toolkit.DESDecrypt(
input_string => encrypted_string,
key_string => key_string,
decrypted_string => decrypted_string );
dbms_output.put_line('> decrypted string output : ' ||
decrypted_string);
end;
Thanks & Regards
Abdullah Gilani
Email: syedgilani@hotmail.com
|
|
|
|
Re: PassWord encryption and decryption [message #18673 is a reply to message #18657] |
Sun, 10 February 2002 20:11   |
Abdullah Gilani
Messages: 18 Registered: October 2001
|
Junior Member |
|
|
hi Rick,
if you would like to set default password you may handle in Programming,
or
if you would like to insert automatically with default 'WELCOME' as password.....please follow the following example,
create table LOGIN (Userid varchar2(20), Password varchar2(16));
Alter table Login modify password varchar2(16) default 'WELCOME';
insert into Login (userid) values ('gilani');
select * from Login;
Regards,
Abdullah Gilani,
Email: syedgilani@hotmail.com
|
|
|
Re: PassWord encryption and decryption [message #558919 is a reply to message #18673] |
Wed, 27 June 2012 06:01   |
 |
parthiv_t
Messages: 15 Registered: July 2011 Location: ahmedabad
|
Junior Member |
|
|
Hello
If I assign values Input_string more than or less than 8 character word
it will Shows me error.
ORA-28232: invalid input length for obfuscation toolkit
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT_FFI", line 21
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT
If I want to use this pl/sql block in my application, not necessarily user input their password which contain 8 characters only.
So can you please help me?
Thanks and regards
Parthiv
[Updated on: Wed, 27 June 2012 06:05] Report message to a moderator
|
|
|
|
|
|
Re: PassWord encryption and decryption [message #565246 is a reply to message #565244] |
Sat, 01 September 2012 05:43   |
John Watson
Messages: 8968 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Are you sure about this?orcl>
orcl>
orcl> select encrypt_pwd('password') from dual;
ENCRYPT_PWD('PASSWORD')
------------------------------------------------------------
;<=>?@AB
orcl> select encrypt_pwd('another1') from dual;
ENCRYPT_PWD('ANOTHER1')
------------------------------------------------------------
;<=>?@AB
orcl> select decrypt_pwd(';<=>?@AB') from dual;
select decrypt_pwd(';<=>?@AB') from dual
*
ERROR at line 1:
ORA-01426: numeric overflow
ORA-06512: at "SCOTT.DECRYPT_PWD", line 18
orcl>
|
|
|
|