Skip to content

Commit fec725d

Browse files
add modes: -m 10830, 10840, 10870
1 parent ef333b8 commit fec725d

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ add mode: sha1crypt -m 15100
66
add mode: sm3crypt -m 35100
77
add mode: cmiyc (KoreLogic CMIYC 2026 contest algo)
88
add modes: Streebog/GOST 2012 -m 11700, 11750, 11760, 11800, 11850, 11860
9+
add modes: SHA-384 UTF-16LE -m 10830, 10840, 10870
910
```
1011
### v1.3.1; 2026-04-13
1112
```

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ To use hashgen, type your mode, wordlist input & hash output files with a simple
129129
| sha384 | 10800 |
130130
| sha384passsalt | 10810 |
131131
| sha384saltpass | 10820 |
132+
| 10830 | (hashcat compatible sha384 utf16le($pass).$salt) |
133+
| 10840 | (hashcat compatible sha384 $salt.utf16le($pass)) |
134+
| 10870 | (hashcat compatible sha384 utf16le($pass)) |
132135
| sha512 | 1700 |
133136
| sha512passsalt | 1710 |
134137
| sha512saltpass | 1720 |

‎hashgen.go‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

8081
func versionFunc() {
@@ -162,6 +163,9 @@ func helpFunc() {
162163
"sha384\t\t10800\n" +
163164
"sha384passsalt\t10810\n" +
164165
"sha384saltpass\t10820\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\t1700\n" +
166170
"sha512passsalt\t1710\n" +
167171
"sha512saltpass\t1720\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
303345
func 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

Comments
 (0)