ldap-passwords
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -1,10 +0,1 @@ | ||
import { verifyMD5 } from './md5.js'; | ||
import { verifySSHA } from './ssha.js'; | ||
import { verifySha512Crypt } from './sha512.js'; | ||
export function ldapVerifyAll(textPassword, hashedPassword) { | ||
return verifyMD5(textPassword, hashedPassword) || verifySSHA(textPassword, hashedPassword) || verifySha512Crypt(textPassword, hashedPassword); | ||
} | ||
export { md5, verifyMD5 } from './md5.js'; | ||
export { ssha, verifySSHA } from './ssha.js'; | ||
export { sha512Crypt, verifySha512Crypt } from './sha512.js'; | ||
//# sourceMappingURL=index.js.map | ||
import{verifyMD5}from"./md5.js";import{verifySha512Crypt}from"./sha512.js";import{verifySSHA}from"./ssha.js";export function ldapVerifyAll(textPassword,hashedPassword){return verifyMD5(textPassword,hashedPassword)||verifySSHA(textPassword,hashedPassword)||verifySha512Crypt(textPassword,hashedPassword)}export{md5,verifyMD5}from"./md5.js";export{sha512Crypt,verifySha512Crypt}from"./sha512.js";export{ssha,verifySSHA}from"./ssha.js"; |
@@ -1,27 +0,1 @@ | ||
import { Buffer } from 'node:buffer'; | ||
import { createHash } from 'node:crypto'; | ||
function _(textPassword) { | ||
const md5Hash = createHash('md5'); | ||
md5Hash.update(textPassword, 'utf-8'); | ||
const md5Raw = md5Hash.digest('hex'); | ||
const md5HexBuffer = Buffer.from(md5Raw, 'hex'); | ||
const md5B64 = md5HexBuffer.toString('base64'); | ||
return `{MD5}${md5B64}`; | ||
} | ||
export function md5(textPassword) { | ||
return _(textPassword); | ||
} | ||
export function verifyMD5(textPassword, md5Password) { | ||
let isValid = false; | ||
const md5Passwords = typeof md5Password === 'string' ? [md5Password] : md5Password; | ||
for (const cryptPasswd of md5Passwords) { | ||
const hashType = cryptPasswd.match(/\{([^}]+)\}/); | ||
if (hashType && hashType[1] === 'MD5') { | ||
const hashedPassword = md5(textPassword); | ||
if (hashedPassword === cryptPasswd) | ||
isValid = true; | ||
} | ||
} | ||
return isValid; | ||
} | ||
//# sourceMappingURL=md5.js.map | ||
import{Buffer}from"node:buffer";import{createHash}from"node:crypto";function _(textPassword){const md5Hash=createHash("md5");md5Hash.update(textPassword,"utf8");const md5Raw=md5Hash.digest("hex");const md5HexBuffer=Buffer.from(md5Raw,"hex");const md5B64=md5HexBuffer.toString("base64");return`{MD5}${md5B64}`}export function md5(textPassword){return _(textPassword)}export function verifyMD5(textPassword,md5Password){let isValid=false;const md5Passwords=typeof md5Password==="string"?[md5Password]:md5Password;for(const cryptPasswd of md5Passwords){const hashType=cryptPasswd.match(/\{([^}]+)\}/);if(hashType&&hashType[1]==="MD5"){const hashedPassword=md5(textPassword);if(hashedPassword===cryptPasswd)isValid=true}}return isValid} |
@@ -1,255 +0,1 @@ | ||
import { randomBytes } from 'node:crypto'; | ||
class Int64 { | ||
constructor(h, l) { | ||
this.h = h; | ||
this.l = l; | ||
} | ||
} | ||
function int64copy(dst, src) { | ||
dst.h = src.h; | ||
dst.l = src.l; | ||
} | ||
function int64rrot(dst, x, shift) { | ||
dst.l = (x.l >>> shift) | (x.h << (32 - shift)); | ||
dst.h = (x.h >>> shift) | (x.l << (32 - shift)); | ||
} | ||
function int64revrrot(dst, x, shift) { | ||
dst.l = (x.h >>> shift) | (x.l << (32 - shift)); | ||
dst.h = (x.l >>> shift) | (x.h << (32 - shift)); | ||
} | ||
function int64shr(dst, x, shift) { | ||
dst.l = (x.l >>> shift) | (x.h << (32 - shift)); | ||
dst.h = (x.h >>> shift); | ||
} | ||
function int64add(dst, x, y) { | ||
const w0 = (x.l & 0xFFFF) + (y.l & 0xFFFF); | ||
const w1 = (x.l >>> 16) + (y.l >>> 16) + (w0 >>> 16); | ||
const w2 = (x.h & 0xFFFF) + (y.h & 0xFFFF) + (w1 >>> 16); | ||
const w3 = (x.h >>> 16) + (y.h >>> 16) + (w2 >>> 16); | ||
dst.l = (w0 & 0xFFFF) | (w1 << 16); | ||
dst.h = (w2 & 0xFFFF) | (w3 << 16); | ||
} | ||
function int64add4(dst, a, b, c, d) { | ||
const w0 = (a.l & 0xFFFF) + (b.l & 0xFFFF) + (c.l & 0xFFFF) + (d.l & 0xFFFF); | ||
const w1 = (a.l >>> 16) + (b.l >>> 16) + (c.l >>> 16) + (d.l >>> 16) + (w0 >>> 16); | ||
const w2 = (a.h & 0xFFFF) + (b.h & 0xFFFF) + (c.h & 0xFFFF) + (d.h & 0xFFFF) + (w1 >>> 16); | ||
const w3 = (a.h >>> 16) + (b.h >>> 16) + (c.h >>> 16) + (d.h >>> 16) + (w2 >>> 16); | ||
dst.l = (w0 & 0xFFFF) | (w1 << 16); | ||
dst.h = (w2 & 0xFFFF) | (w3 << 16); | ||
} | ||
function int64add5(dst, a, b, c, d, e) { | ||
const w0 = (a.l & 0xFFFF) + (b.l & 0xFFFF) + (c.l & 0xFFFF) + (d.l & 0xFFFF) + (e.l & 0xFFFF); | ||
const w1 = (a.l >>> 16) + (b.l >>> 16) + (c.l >>> 16) + (d.l >>> 16) + (e.l >>> 16) + (w0 >>> 16); | ||
const w2 = (a.h & 0xFFFF) + (b.h & 0xFFFF) + (c.h & 0xFFFF) + (d.h & 0xFFFF) + (e.h & 0xFFFF) + (w1 >>> 16); | ||
const w3 = (a.h >>> 16) + (b.h >>> 16) + (c.h >>> 16) + (d.h >>> 16) + (e.h >>> 16) + (w2 >>> 16); | ||
dst.l = (w0 & 0xFFFF) | (w1 << 16); | ||
dst.h = (w2 & 0xFFFF) | (w3 << 16); | ||
} | ||
function extend(source, sizeRef) { | ||
let extended = ''; | ||
for (let i = 0; i < Math.floor(sizeRef / 64); i++) | ||
extended += source; | ||
extended += source.substr(0, sizeRef % 64); | ||
return extended; | ||
} | ||
function rstrSha512(s) { | ||
return binb2rstr(binbSha512(rstr2binb(s), s.length * 8)); | ||
} | ||
function rstr2binb(input) { | ||
const output = Array(input.length >> 2); | ||
for (let i = 0; i < output.length; i++) | ||
output[i] = 0; | ||
for (let i = 0; i < input.length * 8; i += 8) | ||
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32); | ||
return output; | ||
} | ||
function binb2rstr(input) { | ||
let output = ''; | ||
for (let i = 0; i < input.length * 32; i += 8) | ||
output += String.fromCharCode((input[i >> 5] >>> (24 - i % 32)) & 0xFF); | ||
return output; | ||
} | ||
function binbSha512(x, len) { | ||
const sha512K = [new Int64(0x428A2F98, -685199838), new Int64(0x71374491, 0x23EF65CD), new Int64(-1245643825, -330482897), new Int64(-373957723, -2121671748), new Int64(0x3956C25B, -213338824), new Int64(0x59F111F1, -1241133031), new Int64(-1841331548, -1357295717), new Int64(-1424204075, -630357736), new Int64(-670586216, -1560083902), new Int64(0x12835B01, 0x45706FBE), new Int64(0x243185BE, 0x4EE4B28C), new Int64(0x550C7DC3, -704662302), new Int64(0x72BE5D74, -226784913), new Int64(-2132889090, 0x3B1696B1), new Int64(-1680079193, 0x25C71235), new Int64(-1046744716, -815192428), new Int64(-459576895, -1628353838), new Int64(-272742522, 0x384F25E3), new Int64(0xFC19DC6, -1953704523), new Int64(0x240CA1CC, 0x77AC9C65), new Int64(0x2DE92C6F, 0x592B0275), new Int64(0x4A7484AA, 0x6EA6E483), new Int64(0x5CB0A9DC, -1119749164), new Int64(0x76F988DA, -2096016459), new Int64(-1740746414, -295247957), new Int64(-1473132947, 0x2DB43210), new Int64(-1341970488, -1728372417), new Int64(-1084653625, -1091629340), new Int64(-958395405, 0x3DA88FC2), new Int64(-710438585, -1828018395), new Int64(0x6CA6351, -536640913), new Int64(0x14292967, 0xA0E6E70), new Int64(0x27B70A85, 0x46D22FFC), new Int64(0x2E1B2138, 0x5C26C926), new Int64(0x4D2C6DFC, 0x5AC42AED), new Int64(0x53380D13, -1651133473), new Int64(0x650A7354, -1951439906), new Int64(0x766A0ABB, 0x3C77B2A8), new Int64(-2117940946, 0x47EDAEE6), new Int64(-1838011259, 0x1482353B), new Int64(-1564481375, 0x4CF10364), new Int64(-1474664885, -1136513023), new Int64(-1035236496, -789014639), new Int64(-949202525, 0x654BE30), new Int64(-778901479, -688958952), new Int64(-694614492, 0x5565A910), new Int64(-200395387, 0x5771202A), new Int64(0x106AA070, 0x32BBD1B8), new Int64(0x19A4C116, -1194143544), new Int64(0x1E376C08, 0x5141AB53), new Int64(0x2748774C, -544281703), new Int64(0x34B0BCB5, -509917016), new Int64(0x391C0CB3, -976659869), new Int64(0x4ED8AA4A, -482243893), new Int64(0x5B9CCA4F, 0x7763E373), new Int64(0x682E6FF3, -692930397), new Int64(0x748F82EE, 0x5DEFB2FC), new Int64(0x78A5636F, 0x43172F60), new Int64(-2067236844, -1578062990), new Int64(-1933114872, 0x1A6439EC), new Int64(-1866530822, 0x23631E28), new Int64(-1538233109, -561857047), new Int64(-1090935817, -1295615723), new Int64(-965641998, -479046869), new Int64(-903397682, -366583396), new Int64(-779700025, 0x21C0C207), new Int64(-354779690, -840897762), new Int64(-176337025, -294727304), new Int64(0x6F067AA, 0x72176FBA), new Int64(0xA637DC5, -1563912026), new Int64(0x113F9804, -1090974290), new Int64(0x1B710B35, 0x131C471B), new Int64(0x28DB77F5, 0x23047D84), new Int64(0x32CAAB7B, 0x40C72493), new Int64(0x3C9EBE0A, 0x15C9BEBC), new Int64(0x431D67C4, -1676669620), new Int64(0x4CC5D4BE, -885112138), new Int64(0x597F299C, -60457430), new Int64(0x5FCB6FAB, 0x3AD6FAEC), new Int64(0x6C44198C, 0x4A475817)]; | ||
const H = [new Int64(0x6A09E667, -205731576), new Int64(-1150833019, -2067093701), new Int64(0x3C6EF372, -23791573), new Int64(-1521486534, 0x5F1D36F1), new Int64(0x510E527F, -1377402159), new Int64(-1694144372, 0x2B3E6C1F), new Int64(0x1F83D9AB, -79577749), new Int64(0x5BE0CD19, 0x137E2179)]; | ||
const T1 = new Int64(0, 0); | ||
const T2 = new Int64(0, 0); | ||
const a = new Int64(0, 0); | ||
const b = new Int64(0, 0); | ||
const c = new Int64(0, 0); | ||
const d = new Int64(0, 0); | ||
const e = new Int64(0, 0); | ||
const f = new Int64(0, 0); | ||
const g = new Int64(0, 0); | ||
const h = new Int64(0, 0); | ||
const s0 = new Int64(0, 0); | ||
const s1 = new Int64(0, 0); | ||
const Ch = new Int64(0, 0); | ||
const Maj = new Int64(0, 0); | ||
const r1 = new Int64(0, 0); | ||
const r2 = new Int64(0, 0); | ||
const r3 = new Int64(0, 0); | ||
let j; | ||
let i; | ||
const W = Array.from({ length: 80 }); | ||
for (i = 0; i < 80; i++) | ||
W[i] = new Int64(0, 0); | ||
x[len >> 5] |= 0x80 << (24 - (len & 0x1F)); | ||
x[((len + 128 >> 10) << 5) + 31] = len; | ||
for (i = 0; i < x.length; i += 32) { | ||
int64copy(a, H[0]); | ||
int64copy(b, H[1]); | ||
int64copy(c, H[2]); | ||
int64copy(d, H[3]); | ||
int64copy(e, H[4]); | ||
int64copy(f, H[5]); | ||
int64copy(g, H[6]); | ||
int64copy(h, H[7]); | ||
for (j = 0; j < 16; j++) { | ||
W[j].h = x[i + 2 * j]; | ||
W[j].l = x[i + 2 * j + 1]; | ||
} | ||
for (j = 16; j < 80; j++) { | ||
int64rrot(r1, W[j - 2], 19); | ||
int64revrrot(r2, W[j - 2], 29); | ||
int64shr(r3, W[j - 2], 6); | ||
s1.l = r1.l ^ r2.l ^ r3.l; | ||
s1.h = r1.h ^ r2.h ^ r3.h; | ||
int64rrot(r1, W[j - 15], 1); | ||
int64rrot(r2, W[j - 15], 8); | ||
int64shr(r3, W[j - 15], 7); | ||
s0.l = r1.l ^ r2.l ^ r3.l; | ||
s0.h = r1.h ^ r2.h ^ r3.h; | ||
int64add4(W[j], s1, W[j - 7], s0, W[j - 16]); | ||
} | ||
for (j = 0; j < 80; j++) { | ||
Ch.l = (e.l & f.l) ^ (~e.l & g.l); | ||
Ch.h = (e.h & f.h) ^ (~e.h & g.h); | ||
int64rrot(r1, e, 14); | ||
int64rrot(r2, e, 18); | ||
int64revrrot(r3, e, 9); | ||
s1.l = r1.l ^ r2.l ^ r3.l; | ||
s1.h = r1.h ^ r2.h ^ r3.h; | ||
int64rrot(r1, a, 28); | ||
int64revrrot(r2, a, 2); | ||
int64revrrot(r3, a, 7); | ||
s0.l = r1.l ^ r2.l ^ r3.l; | ||
s0.h = r1.h ^ r2.h ^ r3.h; | ||
Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l); | ||
Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h); | ||
int64add5(T1, h, s1, Ch, sha512K[j], W[j]); | ||
int64add(T2, s0, Maj); | ||
int64copy(h, g); | ||
int64copy(g, f); | ||
int64copy(f, e); | ||
int64add(e, d, T1); | ||
int64copy(d, c); | ||
int64copy(c, b); | ||
int64copy(b, a); | ||
int64add(a, T1, T2); | ||
} | ||
int64add(H[0], H[0], a); | ||
int64add(H[1], H[1], b); | ||
int64add(H[2], H[2], c); | ||
int64add(H[3], H[3], d); | ||
int64add(H[4], H[4], e); | ||
int64add(H[5], H[5], f); | ||
int64add(H[6], H[6], g); | ||
int64add(H[7], H[7], h); | ||
} | ||
const hash = Array.from({ length: 16 }); | ||
for (i = 0; i < 8; i++) { | ||
hash[2 * i] = H[i].h; | ||
hash[2 * i + 1] = H[i].l; | ||
} | ||
return hash; | ||
} | ||
function sha512cryptIntermediate(password, salt) { | ||
const digest = rstrSha512(password + salt + password); | ||
const digestExtended = extend(digest, password.length); | ||
let intermediateInput = password + salt + digestExtended; | ||
for (let cnt = password.length; cnt > 0; cnt >>= 1) { | ||
if ((cnt & 1) !== 0) | ||
intermediateInput += digest; | ||
else | ||
intermediateInput += password; | ||
} | ||
const intermediate = rstrSha512(intermediateInput); | ||
return intermediate; | ||
} | ||
function rstrSha512crypt(password, salt, rounds) { | ||
const digestA = sha512cryptIntermediate(password, salt); | ||
let dpInput = ''; | ||
for (let i = 0; i < password.length; i++) | ||
dpInput += password; | ||
const dp = rstrSha512(dpInput); | ||
const p = extend(dp, password.length); | ||
let dsInput = ''; | ||
for (let i = 0; i < (16 + digestA.charCodeAt(0)); i++) | ||
dsInput += salt; | ||
const ds = rstrSha512(dsInput); | ||
const s = extend(ds, salt.length); | ||
let digest = digestA; | ||
let cInput = ''; | ||
for (let i = 0; i < rounds; i++) { | ||
cInput = ''; | ||
if (i & 1) | ||
cInput += p; | ||
else | ||
cInput += digest; | ||
if (i % 3) | ||
cInput += s; | ||
if (i % 7) | ||
cInput += p; | ||
if (i & 1) | ||
cInput += digest; | ||
else | ||
cInput += p; | ||
digest = rstrSha512(cInput); | ||
} | ||
return digest; | ||
} | ||
function _(password, salt) { | ||
const hash = rstrSha512crypt(password, salt, 5000); | ||
const input = hash; | ||
let output = ''; | ||
const tab = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; | ||
const order = [42, 21, 0, 1, 43, 22, 23, 2, 44, 45, 24, 3, 4, 46, 25, 26, 5, 47, 48, 27, 6, 7, 49, 28, 29, 8, 50, 51, 30, 9, 10, 52, 31, 32, 11, 53, 54, 33, 12, 13, 55, 34, 35, 14, 56, 57, 36, 15, 16, 58, 37, 38, 17, 59, 60, 39, 18, 19, 61, 40, 41, 20, 62, 63]; | ||
for (let i = 0; i < input.length; i += 3) { | ||
if (order[i + 1] === undefined) { | ||
const char1 = input.charCodeAt(order[i + 0]) & Number.parseInt('00111111', 2); | ||
const char2 = (input.charCodeAt(order[i + 0]) & Number.parseInt('11000000', 2)) >>> 6; | ||
output += tab.charAt(char1) + tab.charAt(char2); | ||
} | ||
else { | ||
const char1 = input.charCodeAt(order[i + 0]) & Number.parseInt('00111111', 2); | ||
const char2 = (((input.charCodeAt(order[i + 0]) & Number.parseInt('11000000', 2)) >>> 6) | (input.charCodeAt(order[i + 1]) & Number.parseInt('00001111', 2)) << 2); | ||
const char3 = (((input.charCodeAt(order[i + 1]) & Number.parseInt('11110000', 2)) >> 4) | (input.charCodeAt(order[i + 2]) & Number.parseInt('00000011', 2)) << 4); | ||
const char4 = (input.charCodeAt(order[i + 2]) & Number.parseInt('11111100', 2)) >>> 2; | ||
output += (tab.charAt(char1) + tab.charAt(char2) + tab.charAt(char3) + tab.charAt(char4)); | ||
} | ||
} | ||
return `{CRYPT}$6$${salt}$${output}`; | ||
} | ||
export function sha512Crypt(textPassword, salt = '') { | ||
if (!salt) | ||
salt = randomBytes(16).toString('base64').substring(0, 16); | ||
if (salt.length > 16) | ||
throw new Error('The maximum length of salt is 16 characters'); | ||
return _(textPassword, salt); | ||
} | ||
export function verifySha512Crypt(textPassword, sha512Password) { | ||
let isValid = false; | ||
const sha512Passwords = typeof sha512Password === 'string' ? [sha512Password] : sha512Password; | ||
for (const cryptPasswd of sha512Passwords) { | ||
const hashType = cryptPasswd.match(/\{([^}]+)\}/); | ||
if (hashType && hashType[1] === 'CRYPT') { | ||
const salt = cryptPasswd.split('$')[2]; | ||
const hashedPassword = sha512Crypt(textPassword, salt); | ||
if (hashedPassword === cryptPasswd) | ||
isValid = true; | ||
} | ||
} | ||
return isValid; | ||
} | ||
//# sourceMappingURL=sha512.js.map | ||
import{randomBytes}from"node:crypto";class Int64{constructor(h,l){this.h=h;this.l=l}}function int64copy(dst,src){dst.h=src.h;dst.l=src.l}function int64rrot(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift;dst.h=x.h>>>shift|x.l<<32-shift}function int64revrrot(dst,x,shift){dst.l=x.h>>>shift|x.l<<32-shift;dst.h=x.l>>>shift|x.h<<32-shift}function int64shr(dst,x,shift){dst.l=x.l>>>shift|x.h<<32-shift;dst.h=x.h>>>shift}function int64add(dst,x,y){const w0=(x.l&65535)+(y.l&65535);const w1=(x.l>>>16)+(y.l>>>16)+(w0>>>16);const w2=(x.h&65535)+(y.h&65535)+(w1>>>16);const w3=(x.h>>>16)+(y.h>>>16)+(w2>>>16);dst.l=w0&65535|w1<<16;dst.h=w2&65535|w3<<16}function int64add4(dst,a,b,c,d){const w0=(a.l&65535)+(b.l&65535)+(c.l&65535)+(d.l&65535);const w1=(a.l>>>16)+(b.l>>>16)+(c.l>>>16)+(d.l>>>16)+(w0>>>16);const w2=(a.h&65535)+(b.h&65535)+(c.h&65535)+(d.h&65535)+(w1>>>16);const w3=(a.h>>>16)+(b.h>>>16)+(c.h>>>16)+(d.h>>>16)+(w2>>>16);dst.l=w0&65535|w1<<16;dst.h=w2&65535|w3<<16}function int64add5(dst,a,b,c,d,e){const w0=(a.l&65535)+(b.l&65535)+(c.l&65535)+(d.l&65535)+(e.l&65535);const w1=(a.l>>>16)+(b.l>>>16)+(c.l>>>16)+(d.l>>>16)+(e.l>>>16)+(w0>>>16);const w2=(a.h&65535)+(b.h&65535)+(c.h&65535)+(d.h&65535)+(e.h&65535)+(w1>>>16);const w3=(a.h>>>16)+(b.h>>>16)+(c.h>>>16)+(d.h>>>16)+(e.h>>>16)+(w2>>>16);dst.l=w0&65535|w1<<16;dst.h=w2&65535|w3<<16}function extend(source,sizeRef){let extended="";for(let i=0;i<Math.floor(sizeRef/64);i++)extended+=source;extended+=source.slice(0,Math.max(0,sizeRef%64));return extended}function rstrSha512(s){return binb2rstr(binbSha512(rstr2binb(s),s.length*8))}function rstr2binb(input){const output=Array(input.length>>2);for(let i=0;i<output.length;i++)output[i]=0;for(let i=0;i<input.length*8;i+=8)output[i>>5]|=(input.codePointAt(i/8)&255)<<24-i%32;return output}function binb2rstr(input){let output="";for(let i=0;i<input.length*32;i+=8)output+=String.fromCodePoint(input[i>>5]>>>24-i%32&255);return output}function binbSha512(x,len){const sha512K=[new Int64(1116352408,-685199838),new Int64(1899447441,602891725),new Int64(-1245643825,-330482897),new Int64(-373957723,-2121671748),new Int64(961987163,-213338824),new Int64(1508970993,-1241133031),new Int64(-1841331548,-1357295717),new Int64(-1424204075,-630357736),new Int64(-670586216,-1560083902),new Int64(310598401,1164996542),new Int64(607225278,1323610764),new Int64(1426881987,-704662302),new Int64(1925078388,-226784913),new Int64(-2132889090,991336113),new Int64(-1680079193,633803317),new Int64(-1046744716,-815192428),new Int64(-459576895,-1628353838),new Int64(-272742522,944711139),new Int64(264347078,-1953704523),new Int64(604807628,2007800933),new Int64(770255983,1495990901),new Int64(1249150122,1856431235),new Int64(1555081692,-1119749164),new Int64(1996064986,-2096016459),new Int64(-1740746414,-295247957),new Int64(-1473132947,766784016),new Int64(-1341970488,-1728372417),new Int64(-1084653625,-1091629340),new Int64(-958395405,1034457026),new Int64(-710438585,-1828018395),new Int64(113926993,-536640913),new Int64(338241895,168717936),new Int64(666307205,1188179964),new Int64(773529912,1546045734),new Int64(1294757372,1522805485),new Int64(1396182291,-1651133473),new Int64(1695183700,-1951439906),new Int64(1986661051,1014477480),new Int64(-2117940946,1206759142),new Int64(-1838011259,344077627),new Int64(-1564481375,1290863460),new Int64(-1474664885,-1136513023),new Int64(-1035236496,-789014639),new Int64(-949202525,106217008),new Int64(-778901479,-688958952),new Int64(-694614492,1432725776),new Int64(-200395387,1467031594),new Int64(275423344,851169720),new Int64(430227734,-1194143544),new Int64(506948616,1363258195),new Int64(659060556,-544281703),new Int64(883997877,-509917016),new Int64(958139571,-976659869),new Int64(1322822218,-482243893),new Int64(1537002063,2003034995),new Int64(1747873779,-692930397),new Int64(1955562222,1575990012),new Int64(2024104815,1125592928),new Int64(-2067236844,-1578062990),new Int64(-1933114872,442776044),new Int64(-1866530822,593698344),new Int64(-1538233109,-561857047),new Int64(-1090935817,-1295615723),new Int64(-965641998,-479046869),new Int64(-903397682,-366583396),new Int64(-779700025,566280711),new Int64(-354779690,-840897762),new Int64(-176337025,-294727304),new Int64(116418474,1914138554),new Int64(174292421,-1563912026),new Int64(289380356,-1090974290),new Int64(460393269,320620315),new Int64(685471733,587496836),new Int64(852142971,1086792851),new Int64(1017036298,365543100),new Int64(1126000580,-1676669620),new Int64(1288033470,-885112138),new Int64(1501505948,-60457430),new Int64(1607167915,987167468),new Int64(1816402316,1246189591)];const H=[new Int64(1779033703,-205731576),new Int64(-1150833019,-2067093701),new Int64(1013904242,-23791573),new Int64(-1521486534,1595750129),new Int64(1359893119,-1377402159),new Int64(-1694144372,725511199),new Int64(528734635,-79577749),new Int64(1541459225,327033209)];const T1=new Int64(0,0);const T2=new Int64(0,0);const a=new Int64(0,0);const b=new Int64(0,0);const c=new Int64(0,0);const d=new Int64(0,0);const e=new Int64(0,0);const f=new Int64(0,0);const g=new Int64(0,0);const h=new Int64(0,0);const s0=new Int64(0,0);const s1=new Int64(0,0);const Ch=new Int64(0,0);const Maj=new Int64(0,0);const r1=new Int64(0,0);const r2=new Int64(0,0);const r3=new Int64(0,0);let j;let i;const W=Array.from({length:80});for(i=0;i<80;i++)W[i]=new Int64(0,0);x[len>>5]|=128<<24-(len&31);x[(len+128>>10<<5)+31]=len;for(i=0;i<x.length;i+=32){int64copy(a,H[0]);int64copy(b,H[1]);int64copy(c,H[2]);int64copy(d,H[3]);int64copy(e,H[4]);int64copy(f,H[5]);int64copy(g,H[6]);int64copy(h,H[7]);for(j=0;j<16;j++){W[j].h=x[i+2*j];W[j].l=x[i+2*j+1]}for(j=16;j<80;j++){int64rrot(r1,W[j-2],19);int64revrrot(r2,W[j-2],29);int64shr(r3,W[j-2],6);s1.l=r1.l^r2.l^r3.l;s1.h=r1.h^r2.h^r3.h;int64rrot(r1,W[j-15],1);int64rrot(r2,W[j-15],8);int64shr(r3,W[j-15],7);s0.l=r1.l^r2.l^r3.l;s0.h=r1.h^r2.h^r3.h;int64add4(W[j],s1,W[j-7],s0,W[j-16])}for(j=0;j<80;j++){Ch.l=e.l&f.l^~e.l&g.l;Ch.h=e.h&f.h^~e.h&g.h;int64rrot(r1,e,14);int64rrot(r2,e,18);int64revrrot(r3,e,9);s1.l=r1.l^r2.l^r3.l;s1.h=r1.h^r2.h^r3.h;int64rrot(r1,a,28);int64revrrot(r2,a,2);int64revrrot(r3,a,7);s0.l=r1.l^r2.l^r3.l;s0.h=r1.h^r2.h^r3.h;Maj.l=a.l&b.l^a.l&c.l^b.l&c.l;Maj.h=a.h&b.h^a.h&c.h^b.h&c.h;int64add5(T1,h,s1,Ch,sha512K[j],W[j]);int64add(T2,s0,Maj);int64copy(h,g);int64copy(g,f);int64copy(f,e);int64add(e,d,T1);int64copy(d,c);int64copy(c,b);int64copy(b,a);int64add(a,T1,T2)}int64add(H[0],H[0],a);int64add(H[1],H[1],b);int64add(H[2],H[2],c);int64add(H[3],H[3],d);int64add(H[4],H[4],e);int64add(H[5],H[5],f);int64add(H[6],H[6],g);int64add(H[7],H[7],h)}const hash=Array.from({length:16});for(i=0;i<8;i++){hash[2*i]=H[i].h;hash[2*i+1]=H[i].l}return hash}function sha512cryptIntermediate(password,salt){const digest=rstrSha512(password+salt+password);const digestExtended=extend(digest,password.length);let intermediateInput=password+salt+digestExtended;for(let cnt=password.length;cnt>0;cnt>>=1){if((cnt&1)!==0)intermediateInput+=digest;else intermediateInput+=password}const intermediate=rstrSha512(intermediateInput);return intermediate}function rstrSha512crypt(password,salt,rounds){const digestA=sha512cryptIntermediate(password,salt);let dpInput="";for(let i=0;i<password.length;i++)dpInput+=password;const dp=rstrSha512(dpInput);const p=extend(dp,password.length);let dsInput="";for(let i=0;i<16+digestA.codePointAt(0);i++)dsInput+=salt;const ds=rstrSha512(dsInput);const s=extend(ds,salt.length);let digest=digestA;let cInput="";for(let i=0;i<rounds;i++){cInput="";if(i&1)cInput+=p;else cInput+=digest;if(i%3)cInput+=s;if(i%7)cInput+=p;if(i&1)cInput+=digest;else cInput+=p;digest=rstrSha512(cInput)}return digest}function _(password,salt){const hash=rstrSha512crypt(password,salt,5e3);const input=hash;let output="";const tab="./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";const order=[42,21,0,1,43,22,23,2,44,45,24,3,4,46,25,26,5,47,48,27,6,7,49,28,29,8,50,51,30,9,10,52,31,32,11,53,54,33,12,13,55,34,35,14,56,57,36,15,16,58,37,38,17,59,60,39,18,19,61,40,41,20,62,63];for(let i=0;i<input.length;i+=3){if(order[i+1]===undefined){const char1=input.codePointAt(order[i+0])&Number.parseInt("00111111",2);const char2=(input.codePointAt(order[i+0])&Number.parseInt("11000000",2))>>>6;output+=tab.charAt(char1)+tab.charAt(char2)}else{const char1=input.codePointAt(order[i+0])&Number.parseInt("00111111",2);const char2=(input.codePointAt(order[i+0])&Number.parseInt("11000000",2))>>>6|(input.codePointAt(order[i+1])&Number.parseInt("00001111",2))<<2;const char3=(input.codePointAt(order[i+1])&Number.parseInt("11110000",2))>>4|(input.codePointAt(order[i+2])&Number.parseInt("00000011",2))<<4;const char4=(input.codePointAt(order[i+2])&Number.parseInt("11111100",2))>>>2;output+=tab.charAt(char1)+tab.charAt(char2)+tab.charAt(char3)+tab.charAt(char4)}}return`{CRYPT}$6$${salt}$${output}`}export function sha512Crypt(textPassword,salt=""){const s=salt||randomBytes(16).toString("base64").slice(0,16);if(s.length>16)throw new Error("The maximum length of salt is 16 characters");return _(textPassword,s)}export function verifySha512Crypt(textPassword,sha512Password){let isValid=false;const sha512Passwords=typeof sha512Password==="string"?[sha512Password]:sha512Password;for(const cryptPasswd of sha512Passwords){const hashType=cryptPasswd.match(/\{([^}]+)\}/);if(hashType&&hashType[1]==="CRYPT"){const salt=cryptPasswd.split("$")[2];const hashedPassword=sha512Crypt(textPassword,salt);if(hashedPassword===cryptPasswd)isValid=true}}return isValid} |
@@ -1,27 +0,1 @@ | ||
import { Buffer } from 'node:buffer'; | ||
import { createHash, randomBytes } from 'node:crypto'; | ||
function _(textPasswd, salt) { | ||
if (!salt) | ||
salt = randomBytes(18); | ||
const hashedPassword = createHash('sha1').update(textPasswd).update(salt); | ||
return `{SSHA}${Buffer.concat([hashedPassword.digest(), salt]).toString('base64')}`; | ||
} | ||
export function ssha(textPassword) { | ||
return _(textPassword); | ||
} | ||
export function verifySSHA(textPassword, sshaPassword) { | ||
let isValid = false; | ||
const sshaPasswords = typeof sshaPassword === 'string' ? [sshaPassword] : sshaPassword; | ||
for (const cryptPasswd of sshaPasswords) { | ||
const hashType = cryptPasswd.match(/\{([^}]+)\}/); | ||
if (hashType && hashType[1] === 'SSHA') { | ||
const buffer = Buffer.from(cryptPasswd.slice(6), 'base64'); | ||
const salt = Uint8Array.prototype.slice.call(buffer, 20); | ||
const hashedPassword = _(textPassword, salt); | ||
if (hashedPassword === cryptPasswd) | ||
isValid = true; | ||
} | ||
} | ||
return isValid; | ||
} | ||
//# sourceMappingURL=ssha.js.map | ||
import{Buffer}from"node:buffer";import{createHash,randomBytes}from"node:crypto";function _(textPasswd,customSalt){const salt=customSalt||randomBytes(18);const hashedPassword=createHash("sha1").update(textPasswd).update(salt);return`{SSHA}${Buffer.concat([hashedPassword.digest(),salt]).toString("base64")}`}export function ssha(textPassword){return _(textPassword)}export function verifySSHA(textPassword,sshaPassword){let isValid=false;const sshaPasswords=typeof sshaPassword==="string"?[sshaPassword]:sshaPassword;for(const cryptPasswd of sshaPasswords){const hashType=cryptPasswd.match(/\{([^}]+)\}/);if(hashType&&hashType[1]==="SSHA"){const buffer=Buffer.from(cryptPasswd.slice(6),"base64");const salt=Uint8Array.prototype.slice.call(buffer,20);const hashedPassword=_(textPassword,salt);if(hashedPassword===cryptPasswd)isValid=true}}return isValid} |
@@ -6,29 +6,29 @@ import { defineConfig } from 'vitepress' | ||
export default defineConfig({ | ||
title: 'Ldap Passwords', | ||
lastUpdated: true, | ||
cleanUrls: true, | ||
sitemap: { | ||
hostname: 'https://ldap-passwords.com', | ||
}, | ||
head: [ | ||
['meta', { name: 'theme-color', content: '#ecb732' }], | ||
['meta', { name: 'og:type', content: 'website' }], | ||
['meta', { name: 'og:locale', content: 'en-US' }], | ||
['meta', { name: 'og:site_name', content: 'Ldap Passwords' }], | ||
], | ||
themeConfig: { | ||
logo: '/logo.svg', | ||
search: { | ||
provider: 'local', | ||
}, | ||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/dethdkn/ldap-passwords' }, | ||
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1.13em" height="1em" viewBox="0 0 576 512"><path fill="currentColor" d="M288 288h-32v-64h32zm288-128v192H288v32H160v-32H0V160zm-416 32H32v128h64v-96h32v96h32zm160 0H192v160h64v-32h64zm224 0H352v128h64v-96h32v96h32v-96h32v96h32z"/></svg>' }, link: 'https://www.npmjs.com/package/ldap-passwords', ariaLabel: 'npm' }, | ||
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.36 14c.08-.66.14-1.32.14-2c0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2m-5.15 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95a8.03 8.03 0 0 1-4.33 3.56M14.34 14H9.66c-.1-.66-.16-1.32-.16-2c0-.68.06-1.35.16-2h4.68c.09.65.16 1.32.16 2c0 .68-.07 1.34-.16 2M12 19.96c-.83-1.2-1.5-2.53-1.91-3.96h3.82c-.41 1.43-1.08 2.76-1.91 3.96M8 8H5.08A7.923 7.923 0 0 1 9.4 4.44C8.8 5.55 8.35 6.75 8 8m-2.92 8H8c.35 1.25.8 2.45 1.4 3.56A8.008 8.008 0 0 1 5.08 16m-.82-2C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2c0 .68.06 1.34.14 2M12 4.03c.83 1.2 1.5 2.54 1.91 3.97h-3.82c.41-1.43 1.08-2.77 1.91-3.97M18.92 8h-2.95a15.65 15.65 0 0 0-1.38-3.56c1.84.63 3.37 1.9 4.33 3.56M12 2C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"/></svg>' }, link: 'https://rosa.dev.br', ariaLabel: 'Me ;)' }, | ||
], | ||
}, | ||
locales: { | ||
root: { label: 'English', ...en }, | ||
pt: { label: 'Português', ...pt }, | ||
}, | ||
title: 'Ldap Passwords', | ||
lastUpdated: true, | ||
cleanUrls: true, | ||
sitemap: { | ||
hostname: 'https://ldap-passwords.com', | ||
}, | ||
head: [ | ||
['meta', { name: 'theme-color', content: '#ecb732' }], | ||
['meta', { name: 'og:type', content: 'website' }], | ||
['meta', { name: 'og:locale', content: 'en-US' }], | ||
['meta', { name: 'og:site_name', content: 'Ldap Passwords' }], | ||
], | ||
themeConfig: { | ||
logo: '/logo.svg', | ||
search: { | ||
provider: 'local', | ||
}, | ||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/dethdkn/ldap-passwords' }, | ||
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1.13em" height="1em" viewBox="0 0 576 512"><path fill="currentColor" d="M288 288h-32v-64h32zm288-128v192H288v32H160v-32H0V160zm-416 32H32v128h64v-96h32v96h32zm160 0H192v160h64v-32h64zm224 0H352v128h64v-96h32v96h32v-96h32v96h32z"/></svg>' }, link: 'https://www.npmjs.com/package/ldap-passwords', ariaLabel: 'npm' }, | ||
{ icon: { svg: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.36 14c.08-.66.14-1.32.14-2c0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2m-5.15 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95a8.03 8.03 0 0 1-4.33 3.56M14.34 14H9.66c-.1-.66-.16-1.32-.16-2c0-.68.06-1.35.16-2h4.68c.09.65.16 1.32.16 2c0 .68-.07 1.34-.16 2M12 19.96c-.83-1.2-1.5-2.53-1.91-3.96h3.82c-.41 1.43-1.08 2.76-1.91 3.96M8 8H5.08A7.923 7.923 0 0 1 9.4 4.44C8.8 5.55 8.35 6.75 8 8m-2.92 8H8c.35 1.25.8 2.45 1.4 3.56A8.008 8.008 0 0 1 5.08 16m-.82-2C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2c0 .68.06 1.34.14 2M12 4.03c.83 1.2 1.5 2.54 1.91 3.97h-3.82c.41-1.43 1.08-2.77 1.91-3.97M18.92 8h-2.95a15.65 15.65 0 0 0-1.38-3.56c1.84.63 3.37 1.9 4.33 3.56M12 2C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"/></svg>' }, link: 'https://rosa.dev.br', ariaLabel: 'Me ;)' }, | ||
], | ||
}, | ||
locales: { | ||
root: { label: 'English', ...en }, | ||
pt: { label: 'Português', ...pt }, | ||
}, | ||
}) |
import { defineConfig } from 'vitepress' | ||
export default defineConfig({ | ||
lang: 'en-US', | ||
description: 'ldap-passwords offers secure password hashing and verification using LDAP password algorithms.', | ||
themeConfig: { | ||
nav: [ | ||
{ text: 'Guide', link: '/guide/' }, | ||
], | ||
sidebar: [ | ||
{ | ||
text: 'Guide', | ||
items: [ | ||
{ text: 'Getting Started', link: '/guide/' }, | ||
{ text: 'ldapVerifyAll', link: '/guide/ldapverifyall' }, | ||
], | ||
}, | ||
{ | ||
text: 'SHA512', | ||
items: [ | ||
{ text: 'sha512Crypt', link: '/guide/sha512crypt' }, | ||
{ text: 'verifySha512Crypt', link: '/guide/verifysha512crypt' }, | ||
], | ||
}, | ||
{ | ||
text: 'SSHA', | ||
items: [ | ||
{ text: 'ssha', link: '/guide/ssha' }, | ||
{ text: 'verifySSHA', link: '/guide/verifyssha' }, | ||
], | ||
}, | ||
{ | ||
text: 'MD5', | ||
items: [ | ||
{ text: 'md5', link: '/guide/md5' }, | ||
{ text: 'verifyMD5', link: '/guide/verifymd5' }, | ||
], | ||
}, | ||
], | ||
editLink: { | ||
pattern: 'https://github.com/dethdkn/ldap-passwords/edit/main/docs/:path', | ||
text: 'Edit this page on GitHub', | ||
}, | ||
docFooter: { | ||
prev: 'Previous page', | ||
next: 'Next page', | ||
}, | ||
footer: { | ||
message: 'Released under the MIT License.', | ||
copyright: '© 2024 Gabriel \'DethDKN\' Rosa', | ||
}, | ||
}, | ||
lang: 'en-US', | ||
description: 'ldap-passwords offers secure password hashing and verification using LDAP password algorithms.', | ||
themeConfig: { | ||
nav: [ | ||
{ text: 'Guide', link: '/guide/' }, | ||
], | ||
sidebar: [ | ||
{ | ||
text: 'Guide', | ||
items: [ | ||
{ text: 'Getting Started', link: '/guide/' }, | ||
{ text: 'ldapVerifyAll', link: '/guide/ldapverifyall' }, | ||
], | ||
}, | ||
{ | ||
text: 'SHA512', | ||
items: [ | ||
{ text: 'sha512Crypt', link: '/guide/sha512crypt' }, | ||
{ text: 'verifySha512Crypt', link: '/guide/verifysha512crypt' }, | ||
], | ||
}, | ||
{ | ||
text: 'SSHA', | ||
items: [ | ||
{ text: 'ssha', link: '/guide/ssha' }, | ||
{ text: 'verifySSHA', link: '/guide/verifyssha' }, | ||
], | ||
}, | ||
{ | ||
text: 'MD5', | ||
items: [ | ||
{ text: 'md5', link: '/guide/md5' }, | ||
{ text: 'verifyMD5', link: '/guide/verifymd5' }, | ||
], | ||
}, | ||
], | ||
editLink: { | ||
pattern: 'https://github.com/dethdkn/ldap-passwords/edit/main/docs/:path', | ||
text: 'Edit this page on GitHub', | ||
}, | ||
docFooter: { | ||
prev: 'Previous page', | ||
next: 'Next page', | ||
}, | ||
footer: { | ||
message: 'Released under the MIT License.', | ||
copyright: '© 2024 Gabriel \'DethDKN\' Rosa', | ||
}, | ||
}, | ||
}) |
import { defineConfig } from 'vitepress' | ||
export default defineConfig({ | ||
lang: 'pt-BR', | ||
description: 'ldap-passwords oferece hashing e verificação de senhas usando algoritmos de senha do LDAP.', | ||
themeConfig: { | ||
nav: [ | ||
{ text: 'Guia', link: '/pt/guide/' }, | ||
], | ||
search: { | ||
provider: 'local', | ||
options: { | ||
locales: { | ||
pt: { | ||
translations: { | ||
button: { | ||
buttonText: 'Pesquisar', | ||
buttonAriaLabel: 'Pesquisar', | ||
}, | ||
modal: { | ||
backButtonTitle: 'Fechar Pesquisa', | ||
displayDetails: 'Mostra Lista Detalhada', | ||
resetButtonTitle: 'Resetar Pesquisa', | ||
noResultsText: 'Nenhum resultado para', | ||
footer: { | ||
navigateText: 'Para Navega', | ||
navigateUpKeyAriaLabel: 'Seta para Cima', | ||
navigateDownKeyAriaLabel: 'Seta para Baixo', | ||
selectText: 'Para Selecionar', | ||
selectKeyAriaLabel: 'Enter', | ||
closeText: 'Para Sair', | ||
closeKeyAriaLabel: 'esc', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
sidebar: [ | ||
{ | ||
text: 'Guia', | ||
items: [ | ||
{ text: 'Começando', link: '/pt/guide/' }, | ||
{ text: 'ldapVerifyAll', link: '/pt/guide/ldapverifyall' }, | ||
], | ||
}, | ||
{ | ||
text: 'SHA512', | ||
items: [ | ||
{ text: 'sha512Crypt', link: '/pt/guide/sha512crypt' }, | ||
{ text: 'verifySha512Crypt', link: '/pt/guide/verifysha512crypt' }, | ||
], | ||
}, | ||
{ | ||
text: 'SSHA', | ||
items: [ | ||
{ text: 'ssha', link: '/pt/guide/ssha' }, | ||
{ text: 'verifySSHA', link: '/pt/guide/verifyssha' }, | ||
], | ||
}, | ||
{ | ||
text: 'MD5', | ||
items: [ | ||
{ text: 'md5', link: '/pt/guide/md5' }, | ||
{ text: 'verifyMD5', link: '/pt/guide/verifymd5' }, | ||
], | ||
}, | ||
], | ||
editLink: { | ||
pattern: 'https://github.com/dethdkn/ldap-passwords/edit/main/docs/:path', | ||
text: 'Edite esta página no GitHub', | ||
}, | ||
docFooter: { | ||
prev: 'Página anterior', | ||
next: 'próxima página', | ||
}, | ||
footer: { | ||
message: 'Lançado sob a licença MIT.', | ||
copyright: '© 2024 Gabriel \'DethDKN\' Rosa', | ||
}, | ||
}, | ||
lang: 'pt-BR', | ||
description: 'ldap-passwords oferece hashing e verificação de senhas usando algoritmos de senha do LDAP.', | ||
themeConfig: { | ||
nav: [ | ||
{ text: 'Guia', link: '/pt/guide/' }, | ||
], | ||
search: { | ||
provider: 'local', | ||
options: { | ||
locales: { | ||
pt: { | ||
translations: { | ||
button: { | ||
buttonText: 'Pesquisar', | ||
buttonAriaLabel: 'Pesquisar', | ||
}, | ||
modal: { | ||
backButtonTitle: 'Fechar Pesquisa', | ||
displayDetails: 'Mostra Lista Detalhada', | ||
resetButtonTitle: 'Resetar Pesquisa', | ||
noResultsText: 'Nenhum resultado para', | ||
footer: { | ||
navigateText: 'Para Navega', | ||
navigateUpKeyAriaLabel: 'Seta para Cima', | ||
navigateDownKeyAriaLabel: 'Seta para Baixo', | ||
selectText: 'Para Selecionar', | ||
selectKeyAriaLabel: 'Enter', | ||
closeText: 'Para Sair', | ||
closeKeyAriaLabel: 'esc', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
sidebar: [ | ||
{ | ||
text: 'Guia', | ||
items: [ | ||
{ text: 'Começando', link: '/pt/guide/' }, | ||
{ text: 'ldapVerifyAll', link: '/pt/guide/ldapverifyall' }, | ||
], | ||
}, | ||
{ | ||
text: 'SHA512', | ||
items: [ | ||
{ text: 'sha512Crypt', link: '/pt/guide/sha512crypt' }, | ||
{ text: 'verifySha512Crypt', link: '/pt/guide/verifysha512crypt' }, | ||
], | ||
}, | ||
{ | ||
text: 'SSHA', | ||
items: [ | ||
{ text: 'ssha', link: '/pt/guide/ssha' }, | ||
{ text: 'verifySSHA', link: '/pt/guide/verifyssha' }, | ||
], | ||
}, | ||
{ | ||
text: 'MD5', | ||
items: [ | ||
{ text: 'md5', link: '/pt/guide/md5' }, | ||
{ text: 'verifyMD5', link: '/pt/guide/verifymd5' }, | ||
], | ||
}, | ||
], | ||
editLink: { | ||
pattern: 'https://github.com/dethdkn/ldap-passwords/edit/main/docs/:path', | ||
text: 'Edite esta página no GitHub', | ||
}, | ||
docFooter: { | ||
prev: 'Página anterior', | ||
next: 'próxima página', | ||
}, | ||
footer: { | ||
message: 'Lançado sob a licença MIT.', | ||
copyright: '© 2024 Gabriel \'DethDKN\' Rosa', | ||
}, | ||
}, | ||
}) |
@@ -0,11 +1,9 @@ | ||
import { inject } from '@vercel/analytics' | ||
import theme from 'vitepress/theme' | ||
import './extend.css' | ||
import { inject } from '@vercel/analytics' | ||
inject() | ||
export default { | ||
...theme, | ||
...theme, | ||
} |
{ | ||
"name": "ldap-passwords", | ||
"type": "module", | ||
"version": "3.0.2", | ||
"description": "ldap-passwords offers secure password hashing and verification using LDAP password algorithms.", | ||
"author": { | ||
"name": "Gabriel 'DethDKN' Rosa", | ||
"email": "gabriel@rosa.dev.br", | ||
"url": "https://rosa.dev.br" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://ldap-passwords.com", | ||
"bugs": "https://github.com/dethdkn/ldap-passwords/issues", | ||
"keywords": [ | ||
"sha512", | ||
"md5", | ||
"ssha", | ||
"ldap", | ||
"crypt", | ||
"passwords", | ||
"hash", | ||
"$6$" | ||
], | ||
"main": "dist/index.js", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "tsc && vitest run", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"docs:dev": "vitepress dev docs", | ||
"docs:build": "vitepress build docs", | ||
"docs:preview": "vitepress preview docs" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^2.13.3", | ||
"@types/node": "^20.12.7", | ||
"@vercel/analytics": "^1.2.2", | ||
"eslint": "8.57.0", | ||
"typescript": "^5.4.5", | ||
"vitepress": "1.1.0", | ||
"vitest": "^1.5.0" | ||
} | ||
"name": "ldap-passwords", | ||
"type": "module", | ||
"version": "3.0.3", | ||
"description": "ldap-passwords offers secure password hashing and verification using LDAP password algorithms.", | ||
"author": { | ||
"name": "Gabriel 'DethDKN' Rosa", | ||
"email": "gabriel@rosa.dev.br", | ||
"url": "https://rosa.dev.br" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://ldap-passwords.com", | ||
"bugs": "https://github.com/dethdkn/ldap-passwords/issues", | ||
"keywords": [ | ||
"sha512", | ||
"md5", | ||
"ssha", | ||
"ldap", | ||
"crypt", | ||
"passwords", | ||
"hash", | ||
"$6$" | ||
], | ||
"main": "dist/index.js", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "tsc && vitest run", | ||
"minify": "find dist -name '*.js' -exec terser {} -o {} \\;", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"docs:dev": "vitepress dev docs", | ||
"docs:build": "vitepress build docs", | ||
"docs:preview": "vitepress preview docs" | ||
}, | ||
"devDependencies": { | ||
"@dethdkn/eslint-config": "^1.5.4", | ||
"@types/node": "^22.1.0", | ||
"@vercel/analytics": "^1.3.1", | ||
"eslint": "9.8.0", | ||
"terser": "^5.31.3", | ||
"typescript": "^5.5.4", | ||
"vitepress": "1.3.1", | ||
"vitest": "^2.0.5" | ||
} | ||
} |
@@ -0,4 +1,4 @@ | ||
export { md5, verifyMD5 } from './md5' | ||
export { sha512Crypt, verifySha512Crypt } from './sha512' | ||
export { ssha, verifySSHA } from './ssha' | ||
export { md5, verifyMD5 } from './md5' | ||
@@ -5,0 +5,0 @@ /** |
245723
8
36
310