Help creating Tiger hash function in Python

  • Thread starter Mark Livingstone
  • Start date
M

Mark Livingstone

Hello!

I am a Uni student and for a project in Information Systems Security due
in just under two weeks, I have tried to make a Python version of the
Biham / Anderson Tiger Hash function. I have put the original C source
and my two files Tiger.py and doHash.py on my website:

http://www.users.on.net/~mlivingstone/

My problems are doubtless basic since I have been teaching myself
Python. My best knowledge is Java :-(

Firstly, in doHash.py, I cannot invoke tiger() without getting unbounded
errors and / or complaints about no such method.

The C code is peppered with typedefs for word64 and word 32 and byte and
I am unsure how to treat these.

t2, t3, t4 are some sort of index into the S-Box table. How can I
pythonise them?

I don't expect you to write my program for me but any help / clues would
be gratefully received. I have been using the latest Core Python
Programming 2E by Wesley Chun which has been very helpful but I have
not found help for these specific areas.

I have taken out all the Bigendian code, Alpha code and ternary operator
within ternary operator code but the C is still a bit complex for me.

Many thanks in advance for your help

MarkL
 
V

Vyacheslav Maslov

I am a Uni student and for a project in Information Systems Security due
in just under two weeks, I have tried to make a Python version of the
Biham / Anderson Tiger Hash function. I have put the original C source
and my two files Tiger.py and doHash.py on my website:

http://www.users.on.net/~mlivingstone/

My problems are doubtless basic since I have been teaching myself
Python. My best knowledge is Java :-(

Firstly, in doHash.py, I cannot invoke tiger() without getting unbounded
errors and / or complaints about no such method.

First of all you should create an instance of you Tiger class, you try
to do this by line:
x = Tiger.Tiger

But this is wrong, because you should call constructor and pass all
necessary parameters, in very simple case:
x = Tiger.Tiger() (if there is no constructor parameters)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top