I was asked at the coding theory course to implement a compression hash function and an iteration technique of my choice.
What is supposed to mean "an iteration technique" ?
I choosed SHA-1 for the hash func.
P.S. Sorry, I'm not a native English speaker, that's why I'm asking such an ambiguous question.
It probably refers to the creation of an iterative hash function using a compression hash function as mentioned here and here.
Related
For reference I only know python so that's what I've been working with.
I've recently been looking into making my own hashing algorithm to further my understanding on how they work, I'm not looking into creating the most cryptographically secure hashing algorithm, just something that is a bit more secure than validating passwds in plain-text.(in other words I don't care if this algorithm has copious amounts of collisions.
From what I understand about hash functions is that they use ???? to obfuscate the input password. Where I'm getting caught up is how the function takes a user input, like "password1" and translates that into numbers the system can work with, then, what exact methods do they use to obfuscate them?
Apologies if this is a stupid question but I cant find any material on this that isn't way beyond my understanding or basic enough where they gloss over what happens inside the hash algorithm.
I was thinking some time if I should post that question here or at crypto.stackexchange.com. I think the question is more related to implementation than to theory, so here we go:
I have decided to use scrypt as the password hashing method for my future backends. Some of my backends are written in Perl, so I plan to use Crypt::ScryptKDF.
It is quite clear how to use it, but one question is left: scrypt is (to my best knowledge) more a key derivation function than a hashing function. So how is the hashing actually done?
Does it just encrypt the (salted) input string (e.g. a password) with the key which it has derived from the same (salted) input string (password), or is there more to it?
I found MurmurHash recently as one of the fastest, and MurmurHash3 is the new version of MurmurHash.
I also found the complete explanation of MurmurHash in a Diagram by Ian Boyd.
This diagram really looks awesome but I understand only a bit of it since I'm still a newbie and have interest in Hashing.
It would be very helpful if someone could help me with a simple MurmurHash3 Flowchart.
Since I'm a newbie and still can't add any comment there, I also don't know how to contact Ian Boyd either, I'm trying to ask it here..
update
I made my own MurmurHash3 flowchart.
Will upload it later
I'm sorry for my noobness and bad in English. Thank you
I know I am reply late, but it may help any one else...
Murmur hashing is a non cryptographic hash function
which is used for hash based look-ups , it uses 3 basic operations as a whole Multiply, Rotate and XOR. It uses multiple constants which are just there to make it good hash function by passing 2 basic tests.
Avalanche Test
Chi-Squared Test
You can watch this video, which I made, for the detail explanation of Murmur Hashing.
I want to generate a MD5 hash of a text file in ABAP. I have not found any standard solution for generating it for a very big file. Function module CALCULATE_HASH_FOR_CHAR does not meet my requirements because it takes a string as an input parameter. Although it works for smaller files, in case of a for example 4 GB file one cannot construct such a big string.
Does anybody know whether there is a standard piece of coding for doing that (my google efforts did not bring me anything) or maybe someone has an MD5 algorithm in ABAP that calculates the hash of a file?
It looks like the implementation of this algorithm is impossible in ABAP because of the fact that the language does not allow arithmetic overflows during the calculations. This should also answer the question why it has not been implemented so far in SAP system. Either way looks that there is no other way as to call an external tool which of course is, regrettably, hardly platform independent.
EDIT: Ok! So with a great help of René and the code of Fast MD5 Implementation in Java I created the implementation of MD5 algorithm in ABAP . This implementation allows to update the calculated hash with more bytes, which of course might be coming from different sources.
There is no method which takes a file so far but anyways most of the work has been done.
Some simple ABAP Unit tests are included in the code, which also document how to use it.
Perhaps you could read the file in data blocks of a couple megabytes and create a hash list of those using the suggested function. And then create a single top hash using the generated hash list.
The SDN is usually a very good starting point for finding ABAP-related solutions. I was able to find this post: http://scn.sap.com/thread/1483479
The author suggests:
Upload the .txt file BUT as BIN.
Calculate the hash code using function MD5_CALCULATE_HASH_FOR_RAW
Are you able to get your file in binary format and use MD5_CALCULATE_HASH_FOR_RAW?
Edit: This post even has a more detailed answer using CALCULATE_HASH_FOR_RAW: http://scn.sap.com/thread/1298723
Quote of Shivanand Kalagi's answer:
STR_LEN = XSTRLEN( DATA ).
CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
EXPORTING
ALG = 'MD5'
DATA = DATA
LENGTH = STR_LEN
IMPORTING
HASH = L_MD5_HASH.
If you have a client/server application and you want to duplicate the same series of random numbers that the rand() function produces on the client, but on a server, what is the algorithm/pseudo code? The client and server would be given the same seed (srand() on the client).
Thank you!
Please note:
Is this not known? If so, please state
Can it be reverse engineered? If so, please post, unless any license agreements would prevent you from doing so. In other words, don't do anything illegal
I am not interested in design suggestions for the client/server application
I understand that there are better and more recent ways to generate rand numbers
From Apple's Darwin source code, here is the Mac implementation of rand(), which should be the same as the one used on iOS. Here also is the random() implementation. They both appear to be drawn from FreeBSD.
Most C compilers I've seen use a linear congruential random number generators for their rand() function. You don't need to reverse engineer it: it's open source.
BTW if this is the basis of some sort of encryption/security system. It's a really bad idea.