1.0.0 • Published 1 year ago

ldap-sha v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

✨ Features

  • Encrypt a plain text password with the Ldap SSHA algorithm.
  • Verify passwords encrypted with SSHA.
  • No external dependencies.

🚀 Setup

  1. Install with your favorite package manager:

    • pnpm : pnpm i ldap-sha
    • npm : npm i ldap-sha
    • yarn : yarn add ldap-sha
    • bun : bun add ldap-sha
  2. Import the function into your project:

import { ssha, verifySSHA } from 'ldap-sha'

⚡️ Usage

  1. Encrypt a plain text password using SSHA:
const encryptedPassword = ssha('mySuperSecretPassword')
// return {SSHA}sTIysPunEI4boe6OwgQO+/tRZao2OWJIbDMvY0g2UlM=
  1. Validate your plain text password with a SSHA encrypted password:\ The SSHA password can be either a single string or an array of strings. The plain text password will be compared to each SSHA password and the function will return true if any of them matches
const isValid = verifySSHA('mySuperSecretPassword', arrayOfSSHAPasswords)
// return true or false

📝 License

Copyright © 2024 Gabriel 'DethDKN' Rosa\ This project is under MIT license

1.0.0

1 year ago