flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > SHA512 macros for fasm |
Author |
|
revolution 22 Jul 2005, 01:39
Using SHA (Secure Hash Algorithm) you can create a signature for your code and/or data to check the integrity.
Attached are macros to compute and embed signature into your code as assembly time. At run time the code can compare the signature and detect any changes. Using the fasm macros is not the fastest way to make a SHA hash but it is more convenient than using an external program to embed the hash later. On my laptop it runs about 125kBytes/second. The generated hash conforms to FIP 180-2 standard for both SHA512 and SHA384, you can select which hash length you want by setting the SHA512_output_length variable. The attachment contains two files: SHA512-fasm.inc - The core SHA512 macros. SHA512-fasm-test.asm - A verifier and simple example showing the use.
Last edited by revolution on 23 Sep 2008, 08:42; edited 1 time in total |
|||||||||||
22 Jul 2005, 01:39 |
|
Vasilev Vjacheslav 22 Jul 2005, 06:15
thanks
ps. some useful links for cryptoalgos: witeg.prv.pl x3chun.com.ne.kr |
|||
22 Jul 2005, 06:15 |
|
revolution 22 Jul 2005, 12:11
Matrix:
The line you show above is the same as in the zip file. What specifically do you think is wrong with it? You should not get any errors if you assemble the test file. It does display the hash values for the verification values but is shouldn't display any errors. What do you get on the output? |
|||
22 Jul 2005, 12:11 |
|
revolution 22 Jul 2005, 12:17
Quote: what do you think which is more secure/or less easy to reverse? MD5 is already broken, although not in a serious manner yet. But special pairs of input block have been constructed to show it's weakness. So far SHA-1 (160 bit) has not had a successful pair of blocks constructed so it might be more secure (but this cannot be proved). SHA-1 has been shown to also have some weaknesses whereby certain attacks can theoretically be done in less than 2^80 rounds. So far SHA224 and up have not been shown to have weaknesses but, once again, this does not mean they are secure. If you want my opinion, I would suggest that a 128 bit hash is not strong enough for todays needs. Use at least 256 bits. |
|||
22 Jul 2005, 12:17 |
|
Matrix 22 Jul 2005, 12:59
mm sorry disregard that error, it was some strange caching of fasmw.exe on win xp, i have exchanged the 2 though...
its ok now thank you |
|||
22 Jul 2005, 12:59 |
|
Reverend 22 Jul 2005, 22:14
Thanks revolution. Great macroses, brilliant piece of work. I didn't even suspect that such a thing is possible
|
|||
22 Jul 2005, 22:14 |
|
IceStudent 06 Aug 2006, 14:31
fasm 1.66
[edited] Last edited by IceStudent on 07 Aug 2006, 06:40; edited 1 time in total |
|||
06 Aug 2006, 14:31 |
|
revolution 06 Aug 2006, 22:55
You need to convert the double hashes (##) to backslash-hash (\#) for the later version of FASM. The double hash is the old FASM syntax and was outlawed recently.
|
|||
06 Aug 2006, 22:55 |
|
IceStudent 07 Aug 2006, 06:40
Thanks, now it works.
|
|||
07 Aug 2006, 06:40 |
|
rugxulo 12 Aug 2006, 01:11
Um, how long does it take to work? What is the expected output? I can't seem to figure it out.
|
|||
12 Aug 2006, 01:11 |
|
Shorn 12 Jul 2007, 07:06
Just for some clarification, MD5/SHA aren't encryptions, they are one-way hashes, with one-way being the key words here. Which means they can't be 'reversed' nor 'decrypted'.
|
|||
12 Jul 2007, 07:06 |
|
Azu 04 Apr 2009, 08:28
Shorn wrote: Just for some clarification, MD5/SHA aren't encryptions, they are one-way hashes, with one-way being the key words here. Which means they can't be 'reversed' nor 'decrypted'. |
|||
04 Apr 2009, 08:28 |
|
LocoDelAssembly 04 Apr 2009, 18:15
Quote:
The number of collisions is INFINITE, not "some". It is very hard to find two messages with the same hash but still there are infinite character strings with the same hash. |
|||
04 Apr 2009, 18:15 |
|
Azu 04 Apr 2009, 20:31
LocoDelAssembly wrote:
|
|||
04 Apr 2009, 20:31 |
|
LocoDelAssembly 04 Apr 2009, 21:10
Quote:
Yep, but encryption is not limited to such small data and still it is truly one way since even a system checking your password is in fact checking if the hash of the supplied input match the one stored (so actually you have from 1 to some N number of valid passwords). Not sure why Shorn made that clarification (because of Vasilev's post maybe?), but it doesn't seems to be "password encryption" what it was discussed here, the clarification looks more general. |
|||
04 Apr 2009, 21:10 |
|
revolution 05 Apr 2009, 01:36
If you want to use a hash on a password then it is not a good idea to use it directly. Things like rainbow tables will break the common passwords with ease. Anyone interested can look into things like PKCS, and more specifically PBKDF2.
|
|||
05 Apr 2009, 01:36 |
|
Azu 05 Apr 2009, 09:01
LocoDelAssembly wrote:
|
|||
05 Apr 2009, 09:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.