mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1892] Fix false positives in gpg format (symmetric encryption) #1262
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1262
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kholia on GitHub (Nov 18, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1892
Originally assigned to: @kholia on GitHub.
Currently, cracking of GPG symmetrically encrypted files lacking "MDC" results in a lot of false positives.
http://www.ssi.gouv.fr/uploads/2015/05/format-Oracles-on-OpenPGP.pdf should be of help.
https://www.reddit.com/r/crypto/comments/ujot7/gpg_dont_know_invalid_packet_ctb48/
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
http://www.ietf.org/rfc/rfc1991.txt
https://github.com/hawken93/gpg-symcrack (based on GnuPG itself)
Format Oracles on OpenPGP paper (backup copy).
@kholia commented on GitHub (Nov 18, 2015):
https://github.com/magnumripper/JohnTheRipper/tree/no-mdc-reduce-candidates has some initial work but nothing promising so far.
@kholia commented on GitHub (Jan 26, 2017):
UPDATE: Even https://github.com/kholia/PGPCrack-NG generates false positives! PGPCrack-NG is just a hacked up version of GnuPG. So solving this problem 100% does not seem to be possible. We can try reducing the number of false positives at best.
@kholia commented on GitHub (Jul 7, 2017):
Note:
Look at how https://github.com/hawken93/gpg-symcrack works, and try to borrow some features from it, to reduce the rate of false positives.
Update:
The
gpg-symcrackprogram does not work at all for files without MDC. For files with MDC, it aborts pretty badly.@kholia commented on GitHub (Jul 7, 2017):
Sample GPG encrypted file to demonstrate the problem of false positives.
The hash is,
$gpg$*0*69*6089a3038b7fb38fb796ec86a43e369646fcbae04f5ae4c8712790157d29d23afaca8518f093e3fe3310225f5f5350615a67c1f34a5a94c2d0bb558d9b005bb81fcb50db26*3*9*2*3*65536*70f8a591dbffa300Brute forcing this hash results in a lot of false positives very quickly. The correct password is
qwertyzxcvb12345.@kholia commented on GitHub (Nov 10, 2017):
One of the false positives is
FutureFuture. PGP 8 wrongly decrypts the .gpg file with this wrong password.Update: Symantec Encryption Desktop 10.4.1 also does not reject the false positive password.
I was hoping to find a "readable" implementation of PGP which rejects the false positives but no luck.
@kholia commented on GitHub (Nov 10, 2017):
With GnuPG 1.4.22 and
FutureFuturepassword,We essentially want to replicate this behavior in our format.
@kholia commented on GitHub (Nov 10, 2017):
I made some progress on this task today. It should be possible to make our format as good as
PGPCrack-NG(essentially modified GnuPG).@kholia commented on GitHub (Nov 10, 2017):
WIP patch,
@kholia commented on GitHub (Nov 11, 2017):
Some other PGP parsers,
https://github.com/postgres/postgres/blob/master/contrib/pgcrypto/pgp-decrypt.c
https://github.com/linuxmint/mint4win/blob/master/src/openpgp/sap/pkt/Packet.py
https://github.com/golang/crypto/blob/master/openpgp/packet/packet.go
@kholia commented on GitHub (Nov 11, 2017):
Further action items,
Can we extend the "compression checks" by doing actual decompression? Do we really need to?
Test "no MDC" stuff with IDEA + 3DES ciphers (done, fixed).
Can we extend
gpg2john.cand the hash format to provide some more control to the user? Specifically, the user should be able to indicate that compression was really used. This way, we can reject cases wherepkttype == 11(the main source of false positives). Can we overload thegpg_common_cur_salt->usagefield to achieve this?Test Twofish with symmetric encryption stuff (done).
@kholia commented on GitHub (Nov 17, 2017):
Currently the code has a comment saying
Random note: MDC is only missing for ciphers with block size <= 64 bits?.The answer to this question is
NO!. Very old PGP version 8.0 is able to use AES-256 (by default), and create output files lacking MDC.Sample files,
secret-twofish.txt.pgp.txt (Twofish, "openwall")
secret.txt.pgp.txt (AES-256, "openwall")
@kholia commented on GitHub (Nov 17, 2017):
We don't support
Old: Symmetrically Encrypted Data Packetcurrently. Such packets don't seem to be common though.Sample file -> secret-idea.txt.pgp.txt (IDEA, "openwall")
@kholia commented on GitHub (Nov 17, 2017):
Quick note,
For very large GPG files (e.g. 100 MB, > 1 GB) having no MDC, we can also generate truncated hashes without impacting the current functionality.
@kholia commented on GitHub (Nov 18, 2017):
Quick note,
The decryption stuff seems to be done twice (?) for symmetric mode hashes. Confirm, and try to fix if required.