Ldap-md5
Ldap MD5 password generator for node
✨ Features
- Encrypt a plain text password with the Ldap MD5 algorithm.
- Verify passwords encrypted with MD5.
- No external dependencies.
- Keep in mind that MD5 is not considered a secure hashing algorithm for storing passwords, as it is vulnerable to various attacks.
🚀 Setup
-
Install with your favorite package manager:
-
pnpm :
pnpm i ldap-md5
- npm :
npm i ldap-md5
- yarn :
yarn add ldap-md5
- bun :
bun add ldap-md5
-
pnpm :
-
Import the function into your project:
import { md5, verifyMD5 } from 'ldap-md5'
⚡️ Usage
- Encrypt a plain text password using md5:
const encryptedPassword = md5('mySuperSecretPassword')
// return {MD5}aTVgaG9NWR2N1eNABkQgYQ==
- Validate your plain text password with a MD5 encrypted password:
The MD5 password can be either a single string or an array of strings. The plain text password will be compared to each MD5 password and the function will return true if any of them matches
const isValid = verifyMD5('mySuperSecretPassword', arrayOfMD5Passwords)
// return true or false
📝 License
Copyright © 2024 Gabriel 'DethDKN' Rosa
This project is under MIT license