@@ -75,6 +75,7 @@ v1.3.2; 2026-08-18
7575 add mode: sm3crypt -m 35100
7676 add mode: cmiyc (KoreLogic CMIYC 2026 contest algo)
7777 add modes: Streebog/GOST 2012 -m 11700, 11750, 11760, 11800, 11850, 11860
78+ add modes: SHA-384 UTF-16LE -m 10830, 10840, 10870
7879*/
7980
8081func versionFunc () {
@@ -162,6 +163,9 @@ func helpFunc() {
162163 "sha384\t \t 10800\n " +
163164 "sha384passsalt\t 10810\n " +
164165 "sha384saltpass\t 10820\n " +
166+ "10830\t \t (hashcat compatible sha384 utf16le($pass).$salt)\n " +
167+ "10840\t \t (hashcat compatible sha384 $salt.utf16le($pass))\n " +
168+ "10870\t \t (hashcat compatible sha384 utf16le($pass))\n " +
165169 "sha512\t \t 1700\n " +
166170 "sha512passsalt\t 1710\n " +
167171 "sha512saltpass\t 1720\n " +
@@ -299,6 +303,44 @@ func utf16LEPassStrict(data []byte) ([]byte, bool) {
299303 return out , true
300304}
301305
306+ // sha384 UTF-16LE family -m 10830 / 10840 / 10870
307+ func sha384UTF16 (password []byte , mode string , saltRaw []byte ) string {
308+ pwU16 , ok := utf16LEPassStrict (password )
309+ if ! ok {
310+ return ""
311+ }
312+
313+ if mode == "10870" || mode == "sha384utf16le" {
314+ h := sha512 .New384 ()
315+ h .Write (pwU16 )
316+ return hex .EncodeToString (h .Sum (nil ))
317+ }
318+
319+ salt := saltRaw
320+ if salt == nil {
321+ salt = make ([]byte , 16 )
322+ if ! fillSaltHex8 (salt ) {
323+ return ""
324+ }
325+ }
326+
327+ h := sha512 .New384 ()
328+ if mode == "10840" || mode == "sha384utf16saltpass" {
329+ h .Write (salt )
330+ h .Write (pwU16 )
331+ } else {
332+ h .Write (pwU16 )
333+ h .Write (salt )
334+ }
335+
336+ sum := h .Sum (nil )
337+ out := make ([]byte , 96 + 1 + len (salt ))
338+ hex .Encode (out [:96 ], sum )
339+ out [96 ] = ':'
340+ copy (out [97 :], salt )
341+ return string (out )
342+ }
343+
302344// hashcat hmac line as hex(digest):salt
303345func hexMACLineDigest (digest []byte , salt []byte ) string {
304346 n := hex .EncodedLen (len (digest ))
@@ -1803,6 +1845,10 @@ func hashBytesDispatch(hashFunc string, data []byte, cost int) (string, bool) {
18031845 copy (out [97 :], salt )
18041846 return string (out ), true
18051847
1848+ // sha384 UTF-16LE - hashcat -m 10830 / 10840 / 10870
1849+ case "10830" , "sha384utf16passsalt" , "10840" , "sha384utf16saltpass" , "10870" , "sha384utf16le" :
1850+ return sha384UTF16 (data , hashFunc , nil ), true
1851+
18061852 // sha2-512 -m 1700
18071853 case "sha2-512" , "sha512" , "1700" :
18081854 h := sha512 .Sum512 (data )
0 commit comments