Skip to content

Commit

Permalink
More correct fix for long passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Nov 16, 2023
1 parent 8e12a8c commit 430ed99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ func main() {
defer wg.Done()
switch *hash {
case "ntlm":
u16 := make([]byte, 4096)
u16 := make([]byte, 16)
mdfour := md4.New()
for password := range queue {
/* Add all bytes, as well as the 0x00 of UTF-16 */
utf16encoded := utf16.Encode([]rune(password))
if cap(u16) < len(utf16encoded)*2 {
u16 = make([]byte, len(utf16encoded)*2)
}
u16 = u16[:len(utf16encoded)*2]
for i, b := range utf16encoded {
u16[i*2] = byte(b)
Expand Down

0 comments on commit 430ed99

Please sign in to comment.