Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2010-11-10 09:00:41

caibutou2008
Member
Registered: 2010-11-08
Posts: 10

crypto1 result different?

I used the crypto1 source code from google and the main.c from Proxmark.org and ran the program. With exact same input data as proxmark.org, I got different key output.

nt': 8d65734b
nt'': 9a427b20
ks2: e38f32ab
ks3: c6ef8f19
Found Key: [45 fa 58 0f 6d 31]

Does anyone know why?

Offline

#2 2010-11-10 18:30:13

hat
Contributor
Registered: 2009-04-12
Posts: 160

Re: crypto1 result different?

could be a number of things

a) you messed something up
b) the compiler you are using compiled crapto1 creatively / there are some bugs

if you could give exact details, paste your .c, your crapto1 version, your compiler version, ..
and anything you may have done. i'll see if i can help you out

alternatively just pop in some linux livecd ^^

Offline

#3 2010-11-10 21:20:40

caibutou2008
Member
Registered: 2010-11-08
Posts: 10

Re: crypto1 result different?

Hi Hat,

I have done the following things,

I used MinGW32 and compiled the files under window command windows. Because I was not able to compile main.c, crypto1.c and crapto1.c together. I actually put all the source code into one file and just compiled that file. During the compile, there were lots of errors, mainly double definitions because some functions are definited in both crypto1.c and crapto1.c. So I just black out the duplicated functions and compile was success and i got totally different data.

The crapto1 was downloaded from google code and it is the only one there.

Offline

#4 2010-11-10 22:45:30

hat
Contributor
Registered: 2009-04-12
Posts: 160

Re: crypto1 result different?

anyways "there were lots of errors, mainly double definitions because some functions are definited in both crypto1.c and crapto1.c. So I just black out the duplicated functions and compile was success "

does not comply with

"if you could give exact details, paste your .c, your crapto1 version, your compiler version, ..
and anything you may have done. i'll see if i can help you out"

I can not help you based on this information.

I don't log on to a culinary forum, and tell them i just combined two recipes made some changes, skipped some steps, and that the result is not tasty.

Last edited by hat (2010-11-10 22:51:35)

Offline

#5 2010-11-11 00:36:50

caibutou2008
Member
Registered: 2010-11-08
Posts: 10

Re: crypto1 result different?

Hat, are you able to tell me the crypto1 source code on this website is the latest?

http://code.google.com/p/crapto1/downloads/list

I use the main.c from http://code.google.com/p/proxmark3/wiki/RunningPM3

The only changes I made was change lfsr_recovery to lfsr_recovery32, and change lfsr_rollback to lfsr_rollback_word.

My compiler version should be mingw-w64-bin_i686-mingw_20100611.

I am sorry that the way i decribed things might be a bit confusing. I am not really familiar with compiling C under linux. And the main purpose is to try this crypto1 function because I have captured some data with Proxmark with a reader and mifare 1K card. And I know the key on this card and I want to verify whether the function works and how it works.

Offline

#6 2010-11-11 02:07:35

hat
Contributor
Registered: 2009-04-12
Posts: 160

Re: crypto1 result different?

seriously dude wasting my time much?

me wrote:

you'll probably want to change lfsr_recovery -> lfsr_recovery64
and those lfsr_rollback -> lfsr_rollback_word iirc. there are other projects like mfoc that bundle crapto so those should be easier to compile.

you wrote:

The only changes I made was change lfsr_recovery to lfsr_recovery32,

see the difference. anyway you may have made more mistakes, i can't help you if you don't share the code you created. If i do it it works. so you can continue with your vague descriptions, or you can just be precise.


ktnx

Offline

#7 2010-11-11 08:18:29

caibutou2008
Member
Registered: 2010-11-08
Posts: 10

Re: crypto1 result different?

Hi Hat,

You know what, as soon as I changed from 32 to 64, it works!!! Thanks a lot! And it also seems the algorithm works on my test data as well but the key generates in a reverse way. Is it what it suppose to be like? For example, the key on my card should be AA BB CC DD EE FF, but the output from algorithm is FF EE DD CC BB AA.

Offline

#8 2010-11-11 12:38:31

hat
Contributor
Registered: 2009-04-12
Posts: 160

Re: crypto1 result different?

the code on that wiki is that old that it prints the key bytes in the wrong order.

Offline

#9 2010-11-11 22:51:45

caibutou2008
Member
Registered: 2010-11-08
Posts: 10

Re: crypto1 result different?

yes, the key is displayed in a reverse order. But it is not a big deal.

Offline

Board footer

Powered by FluxBB