The MD4, MD5 using PLSQL hashing algorithms

Posted by Jiltin     11 November, 2008    3,384 views   

Long back, around 2001, I download the script from http://www.gt.ed.net/keith/plsql/. This link is dead as of date. They are working plsql scripts that I have tested long back.

Introduction
MD4 and MD5 are one-way hashing algorithms designed to create compact, fixed-length (256 bit) digital signatures (checksums/fingerprints) by generating hashes that are unique and not reversible. They are also useful to provide secure hashing of passwords, especially when robust password validation is used or when a salt with a large key space is used to complicate the use of password dictionaries. MD4 is faster while MD5 is more secure.

The performance of the algorithms are quite slow in PL/SQL. You may try optimizing the algorithms’ implementation by compiling your PL/SQL code under Oracle9. Representing the character strings as an array of PLS_INTEGER ASCII codes would improve performance by eliminating the need for string manipulation operations. I will welcome, credit, and distribute these or other optimization fixes.

Oracle8 or greater does give you the ability to use procedures written in native languages that have binary operations for greater performance (I wrote this before Oracle8 existed). See www.fourmilab.ch/md5 for a good command-line version of MD5 for Unix and Windows platforms. Oracle8 also provides a standard obfuscation package for weak two-way encryption needs, which may be used to encrypt passwords with greater performance. Also, Oracle now has a security toolkit for more extensive cryptography needs.

LIMITATIONS AND NOTES
The algorithm may generate different signatures of the same message for different character sets. A fix for UTF/multi-byte character sets (standard character set used by Oracle8 or greater) has been submitted by Fred Brown and are available below as submitted.

Generic Bitwise Operations and MD4 Algorithm
The source is provided below for the generic bitwise operations package (bw) and the source of MD4 that uses this generic bitwise operations package. You must download and start bw.txt to use md4.txt.

Download bw.txt
Download md4.txt

Fast Unsigned 32-Bit Bitwise Operations and MD4/5 Algorithms FOR US7ASCII/SINGLE-BYTE CHARACTER SETS
The source is provided below for the unsigned 32-bit bitwise operations package (fbw) and the source of MD4/5 that uses this optimized bitwise operations package. You must download and start fast_bw.txt to use fast_md4.txt or fast_md5.txt.

Download fast_bw.txt
Download fast_md4.txt
Download fast_md5.txt

Fast Unsigned 32-Bit Bitwise Operations and MD5 Algorithms FOR UTF/MULTI-BYTE CHARACTER SETS
The source is provided below for the fast unsigned 32-bit bitwise operations and MD5 algorithm with UTF/multi-byte character sets (standard character set of Oracle8 or greater) fix as submitted by Fred Brown. You must download and start md5_main.txt to use md5_fast.txt.

Download md5_main.txt
Downloadmd5_fast.txt

Here is the original work and credit for the author Keith Gardner.
/**************************************************************************
**
** Fast 32-bit Unsigned Binary Operations Library
**
** Version 1.0, 6/11/98
** Licensing updated 4/29/02
**
** Based on Kevin Taufner’s version 1.0, 7/20/97, Util package.
**
** Written by Keith Gardner
**
**
**————————————————————————-
**
** Copyright (C) 1998, 2002 Wallace Keith Gardner.
** All rights reserved.
**
** This file is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**
** You must download, read, agree, and retain a copy of the GNU Lesser
** General Public License with this software. It can be found at:
**
** You must download, read, agree, and retain a copy of the Terms
** of Use and Disclaimer with this software. It can be found at:
**
**
***************************************************************************/

Following Google Searches Lead To This Post: plsql hash function code
MD4 MD5 Oracle
http://www.gt.ed.net/keith/plsql/
plsql hash
checksum plsql
make password hash plsql
oracle md5 calc
software license key algorithm for pl sql code
sha2 in pl sql
oracle md5 hash
pl sql get md5 hash
pl/sql md5
hash +plsql
md5 +plsql
oracle checksum character plsql
md5 algorithm in plsql
md5 summe mit pl sql
pl/sql query for hashing password
flops md5
MD5 plsql
encryption from plpgsql
oracle +plsql +password +MD5
hash algorithm plsql
pl sql and md5
plsql md5
md5 generator code for plsql
create md5 checksum in oracle pl/sql
MD5 hash Oracle / PL SQL
plsql + md5
md4 reversible
pl sql hash file
plsql + hash function
Oracle pl/sql how to generate HASH code for a string
encrypt using md4 in php
oracle md5 base64 function
hash pl sql
hashCODE MD5 function oracle
pl sql hash
using md5 oracle password
linux shell script last 32 characters md5
“hash to string”
oracle md5 script
md5 using pl/sql oracle 10
md5 oracle 10g
oracle 11 md5
get md5 hash from plsql
md5.pl download
oracle md5 base64
md5 hash oracle
plsql generat md5
plsql md5 hash function
using md4 in sql server
pl sql hash function
sql md5 from char
plpgsql hash
plpgsql generer hash
plpgsql md5
how generate an md5 in oracle
md5 pl/sql
pl/sql algorithms
pl sql hash key
MD4 hash c#.net
oracle md4
pl sql md5 hash
oracle md5 number uniqueness
code hash function in pl/sql
pl sql web password validation
oracle md5 string
pl/sql md5 10g
plsql in GNU Bash
string hash functions in pl/sql
pl/sql “fast MD5″
pl/sql fast_md5 utf-8
create a checksum plsql
oracle md5 32
oracle pl sql hash md5
md4 hash c# fast
plpgsql get characters from string
pl/sql string mdsum
calc hash in pl/sql
oracle HASH_MD4

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Oracle Tags : , ,

Comments

No comments yet.


Leave a comment

(required)

(required)