Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Additional cryptographic functions for MySQL
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Makefile
README
des.sql
handy.sql
lm.sql
md4.sql
nt.sql
unixmd5.sql

README

MySQL Crypt

A library of cryptographic functions not available by default in mysql.
This library includes functions to create an LM hash, DES hash (not the
triple DES which is included as a built-in function), salted unix md5
hash, MD4 hash, and a NT hash.

It's a useful library for when you are working in the database, otherwise
I would suggest that passwords be encrypted elsewhere and not transfered
over a network in plaintext.

Install by running 'make install', you may have to alter the Makefile
to provide mysql with the correct host, port, user, and password options.

These functions can be used anywhere mysql expects an expression to be:

	mysql> select unixmd5crypt('abc');
	+------------------------------------+
	| unixmd5crypt('abc')                |
	+------------------------------------+
	| $1$soMaLg4U$UyayHy/QbItux779ljKdI1 |
	+------------------------------------+
	1 row in set (0.00 sec)

	mysql> select lmcrypt('abc');
	+----------------------------------+
	| lmcrypt('abc')                   |
	+----------------------------------+
	| 8C6F5D02DEB21501AAD3B435B51404EE |
	+----------------------------------+
	1 row in set (0.06 sec)

	mysql> select md4('abc');
	+----------------------------------+
	| md4('abc')                       |
	+----------------------------------+
	| A448017AAF21D8525FC10AE87AA6729D |
	+----------------------------------+
	1 row in set (0.01 sec)

	mysql> select ntcrypt('abc');
	+----------------------------------+
	| ntcrypt('abc')                   |
	+----------------------------------+
	| E0FBA38268D0EC66EF1CB452D5885E53 |
	+----------------------------------+
	1 row in set (0.01 sec)

Something went wrong with that request. Please try again.