Oracle user password MD5 Encryption

Source: Internet
Author: User

Recently, I was working on upgrading the company's internal system. The original system does not require encryption of passwords. Now I need MD5 encryption.

 

Oracle Database Password MD5 encryption, Oracle provides the MD5 encryption function.

However, if the password is empty, an error is reported. After searching for the password for a long time, I did not find a solution. Finally, I asked

Solve the problem.

 

Fn_md5 function:

 

Create or replace function fn_md5 (input_string in varchar2)

Return varchar2

Is

Raw_input raw (128)

: = Utl_raw.cast_to_raw (input_string );

Decrypted_raw raw (2048 );

Error_in_input_buffer_length exception;

Begin

Dbms_obfuscation_toolkit.md5 (input => raw_input,

Checksum => decrypted_raw

);

Return upper (rawtohex (decrypted_raw ));

End;

 

Encrypted SQL statement:

Update uum_user R set R. user_passwd = decode (R. user_passwd, '', 'd41d8cd98f00b204e9800998ecf8427e ', fn_md5 (R. user_passwd ));

 

Decode (A, B, C, D, E, F ......) Function. If the value of A is equal to B, the function returns C. If the value of A is equal to D, E… is returned .......

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.