Skip to content

Commit

Permalink
fix(pgpwde2john): username, salt and ESK are byte objects
Browse files Browse the repository at this point in the history
  • Loading branch information
iyesin authored and solardiz committed Mar 19, 2024
1 parent 138e01e commit 046d225
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions run/pgpwde2john.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# This software is Copyright (c) 2017, Dhiru Kholia <dhiru.kholia at gmail.com>
# and it is hereby released to the general public under the following terms:
Expand All @@ -10,6 +10,8 @@
#
# Only tested with Symantec Encryption Desktop 10.4.1 MP1 running on Ubuntu
# 12.04.5 LTS, Ubuntu 14.04 LTS, and Windows 7 SP1.
#
# Updated to support python3

import os
import sys
Expand Down Expand Up @@ -234,9 +236,9 @@ def process_file(filename):
continue
userflags, serialNumber, userLocalId, reserved = fields[7:11]
size, symmAlg, totalESKsize, reserved, userName, s2ktype, hashIterations, reserved2, salt, esk = fields[11:]
userName = userName.strip("\x00")
userName = userName.strip(b"\x00").decode()
sys.stderr.write("DEBUG: %s, %s, %s, %s, %s, %s\n" % (size, symmAlg, totalESKsize, userName, s2ktype, hashIterations))
print("%s:$pgpwde$0*%s*%s*%s*%s*%s" % (userName, symmAlg, s2ktype, hashIterations, salt.encode("hex"), esk.encode("hex")[0:256]))
print("%s:$pgpwde$0*%s*%s*%s*%s*%s" % (userName, symmAlg, s2ktype, hashIterations, salt.hex(), esk.hex()))

f.close()

Expand Down

0 comments on commit 046d225

Please sign in to comment.