Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRC 64, Jones Variation #2982

Closed
cyber-speed opened this issue Sep 13, 2021 · 5 comments
Closed

CRC 64, Jones Variation #2982

cyber-speed opened this issue Sep 13, 2021 · 5 comments

Comments

@cyber-speed
Copy link

Algorithm Request: CRC64

Links:
https://gist.github.com/maxpert/c544fade7be86270021ef8799cff73f6
https://pycrc.org/models.html#crc-64-jones

Example hashes and their respective strings:
1ff3210349a44a41 <-> engine\shaders\obj11\h00\hex115ca000.pso
0a40e9038be78981 <-> engine\shaders\obj11\h00\hex13eb5000.pso
00dbbafd89338e15 <-> engine\shaders\obj11\h00\hex350c2200.pso
1ea5d06dcd5c2671 <-> engine\shaders\obj11\h00\hex3dd49f00.pso

Algorithm is found in games.

@jsteube
Copy link
Member

jsteube commented Oct 3, 2021

There's something strange, based on the documentation you have linked.

I can't reproduce your own values with it. Please double check if you example values are correct!

python pycrc --check-string 'engine\shaders\obj11\h00\hex115ca000.pso' --width 64 --poly 0xad93d23594c935a9 --reflect-in True --xor-in 0xffffffffffffffff --reflect-out True --xor-out 0x0000000000000000
0xf6b67e8f38ccdffa
python pycrc --check-string 'engine\shaders\obj11\h00\hex13eb5000.pso' --width 64 --poly 0xad93d23594c935a9 --reflect-in True --xor-in 0xffffffffffffffff --reflect-out True --xor-out 0x0000000000000000                
0xe305b68ffa8f1c3a

@cyber-speed
Copy link
Author

cyber-speed commented Oct 4, 2021

I have been dealing with these CRC64, Jones Variation hashes for years now, i can confirm the examples i posted are accurate, no mistake.
In your test above is completely off though.
I think i forgot about an important link, it has the proper table to make it work:
https://github.com/codeaholics/node-rdb-tools/blob/master/src/crc-64-jones.c

@jsteube
Copy link
Member

jsteube commented Oct 5, 2021

The problem is that you have linked two different resources of which both use different constants and result in different output values with the same input value. Additionally, both claim to be crc64 jones variant. This is very confusing and I don't want to decide between any of the two.

@yretenai
Copy link

yretenai commented Oct 8, 2021

pycrc's test result is incorrect. The linked gist C# and rdb C implementation is correct.

if still in doubt refer to CERN's implementation; https://gitlab.cern.ch/atlas/athena/-/blob/master/Control/CxxUtils/Root/crc64.cxx#L526-529

@jsteube
Copy link
Member

jsteube commented Oct 9, 2021

Your request was implemented with commit d6f8f30

Note that the implementation is limited to 32 characters length for performance reasons.

In your case it's important to know, because your string length is larger, but you can still crack them with hashcat and benefit from this specific optimization.

Actually, you will crack multiple hashes at the same time :)

First you need to find a good offset based on your search path.

engine\shaders\obj11\h00\hex115ca000.pso
engine\shaders\obj11\h00\hex13eb5000.pso
engine\shaders\obj11\h00\hex350c2200.pso
engine\shaders\obj11\h00\hex3dd49f00.pso

They all use the same leading string engine\shaders\obj11\h00\hex, so we do the following:

$ echo 'engine\shaders\obj11\h00\hex' | tools/test.pl passthrough 28000
f121df13ad4ed274:3650642821216718

You will find that in your case the result is a completely different one, that is because the unit test randomizes the IV so the unit test is more reliable.

We need to go to tools/test_modules/m28000.pm and find the line:

  my $salt = shift;

and add the following line below:

$salt = 0;

then run it again:

$ echo 'engine\shaders\obj11\h00\hex' | tools/test.pl passthrough 28000
3f1a3ebd2930f0fe:0000000000000000

Now you should have the same value. With this value we can start the optimized search:

$ cat hash
1ff3210349a44a41:3f1a3ebd2930f0fe
0a40e9038be78981:3f1a3ebd2930f0fe
00dbbafd89338e15:3f1a3ebd2930f0fe
1ea5d06dcd5c2671:3f1a3ebd2930f0fe

$ ./hashcat -m 28000 hash -a 3 ?h?h?h?h?h?h?h?h.pso -w 3 
00dbbafd89338e15:3f1a3ebd2930f0fe:350c2200.pso            
1ea5d06dcd5c2671:3f1a3ebd2930f0fe:3dd49f00.pso            
1ff3210349a44a41:3f1a3ebd2930f0fe:115ca000.pso            
0a40e9038be78981:3f1a3ebd2930f0fe:13eb5000.pso            
                                                          
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 28000 (CRC64Jones)
Hash.Target......: hash
Time.Started.....: Sat Oct  9 11:51:42 2021 (1 sec)
Time.Estimated...: Sat Oct  9 11:51:43 2021 (0 secs)

Good luck!

@jsteube jsteube closed this as completed Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants