10-21-2010 08:04 AM
how to get the inverse of hash function,
Is there any block in labview to get the inverse of this function
10-21-2010 08:19 AM
"A given hash value can not feasibly be reversed to get a message that produces that hash value. I.e. There is no useful inverse hash function f'(hash) = message"
Hash values are intentionally one way streets to validate the integrity of the input string. There is no useful purpose in going the opposite direction.
If that is what you need, then investigate cryptography.
10-21-2010 12:18 PM
i need get back to the original signal using transmit.vi
So i need inverse hash function and RSA decreprition
is there anyway to get back the original signal without using this functions??
10-21-2010 12:46 PM
I don't have LV 9.0, does it have a hash block now? Had to implement my own on LV7.0, which contains an inverse function.
10-21-2010 02:43 PM
Can you explain me how to get the inverse function in LV 7.0
10-21-2010 03:17 PM - edited 10-21-2010 03:21 PM
It is not possible (well almost) to get the original message back from the hash of that function. It would be very unsave if that was even possible. (if it was possible, it would be impossible to us Internet banking in a secure and safe way).
If you want to decrypt an RSA message on the other hand, you will need the private key from the encryption party as explained on wikipedia.
For anyone who is interested I have uploaded a set of VIs to Bitbucket with the following hashes (LabVIEW 2010):
SHA-1
SHA-224
SHA-256
SHA-384
SHA-512
and the HMACs for these hashes.
The SHA posted by desham is SHA-1.
Ton
10-21-2010 05:43 PM
Hash functions are irreversible in general. But if you have a small enough subset of possible hased values you could hash those and see if any of them match. I'm not sure what your transmit function is trying to do, the rsa function seems to just be encrypting the number 31 (and the keys are quite weak), and you're only sending small subsets of the data. In my mind you should hash the entire message, and rsa the message with the attached hash, then you can use the hash to verify the message was decrypted properly. But anyway the hash function is only applied against 2 bytes at a time which is only 2^16 possible values (so pretty easy to generate a table from hash codes to numbers).
I attached a VI that can unhash any two character string (which is all of the hashed values in your transmit example), the first call takes a bit to generate the table then it should run fast. My guess is that transmit function isn't the proper solution for what it's trying to solve.
10-22-2010 03:32 PM
Hi ,
I am finding difficulty with your unhash funtion.
I took the last message from the tranmit function(concatenation message) and tried to unhash it, It doesnt work.
Can u help me
I am trying to take the last message, unhash and decrypt the message so that i can get the original message
10-22-2010 03:57 PM - edited 10-22-2010 04:04 PM
The unhash only works for the chunks of the message that are hashed, and I can only unhash it because only two bytes are ever used in the calls to the hash function.
I'm not sure what you consider to be the original message, the transmit function is only using 8 bytes from the waveform to produce the message, and it's not encrypting any part of the waveform (I can't say for certain what it's doing since I don't have the RSA vi). I doubt the transmit is even doing what it's supposed to.
10-22-2010 08:18 PM
RSA encryption
For Rsa encryption i did the Rsa decryption but i dont know whether it is correct or not