Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #31  
Old 03-22-2012, 18:32
uranus64 uranus64 is offline
VIP
 
Join Date: Mar 2011
Location: EE
Posts: 315
Rept. Given: 595
Rept. Rcvd 462 Times in 140 Posts
Thanks Given: 486
Thanks Rcvd at 241 Times in 82 Posts
uranus64 Reputation: 400-499 uranus64 Reputation: 400-499 uranus64 Reputation: 400-499 uranus64 Reputation: 400-499 uranus64 Reputation: 400-499
@STRELiTZIA. Was posted already. Check this. Anyway, thank's.
Reply With Quote
  #32  
Old 03-26-2012, 00:49
Git's Avatar
Git Git is offline
Old Git
 
Join Date: Mar 2002
Location: Torino
Posts: 1,115
Rept. Given: 220
Rept. Rcvd 265 Times in 157 Posts
Thanks Given: 108
Thanks Rcvd at 216 Times in 124 Posts
Git Reputation: 200-299 Git Reputation: 200-299 Git Reputation: 200-299
Looks like 1.8 may still have some accuracy problems. Output of the Sapphire II hashes seem to be incorrect when compared to the authors test program (Michael Paul Johnson). Test program and Sapphire II hash are very old, so info may not be reliable. Also, author does not recommend using algo for hash bigger than 32 bytes (256 bits).

Code:
Sapphire II Hash of "Hello World"

bits   Author
128    DE0BCBC20DC0D9A8757D9F5A872691BE
160    DE0BCBC20DC0D9A8757D9F5A872691BE3B1386F1
192    DE0BCBC20DC0D9A8757D9F5A872691BE3B1386F149454785
224    DE0BCBC20DC0D9A8757D9F5A872691BE3B1386F149454785F33EF56A
256    DE0BCBC20DC0D9A8757D9F5A872691BE3B1386F149454785F33EF56A04C2CE57

bits   KGA1.8
128    CC5160EFFC89B049C7D98C621F40E962
160    9AB4E676C69D8D197A68FD91502B8C6BFEF7AE16
192    F594394418FD8F25842901D03584CD1927C8E267CDD5CB43
224    575A2E7589332F008514BC4BE7059F33AC7186734CDB4FC611F09322
256    7CE0CF43114C7F198098D08012E5E10BD0DE9E71B2C295607EBB094E3AAA1C4B

Source code of final hash generation is :

Code:
void sapphire::hash_final(unsigned char * hash,     // Destination
                          unsigned char hashlength) // Size of hash.
{
	int i;

	for(i = 255; i >= 0; i--)
		encrypt((unsigned char) i);

	for(i = 0; i < hashlength; i++)
		hash[i] = encrypt(0);
}
That last loop suggests to me that first N bytes of N+4 byte hash should indeed be the same.

Git

Last edited by Git; 03-26-2012 at 00:57.
Reply With Quote
  #33  
Old 03-26-2012, 01:43
Git's Avatar
Git Git is offline
Old Git
 
Join Date: Mar 2002
Location: Torino
Posts: 1,115
Rept. Given: 220
Rept. Rcvd 265 Times in 157 Posts
Thanks Given: 108
Thanks Rcvd at 216 Times in 124 Posts
Git Reputation: 200-299 Git Reputation: 200-299 Git Reputation: 200-299
Also... most of the hashes should produce a valid hash of a zero length input string or byte array. You can see some examples in the Haval validation test program, where most of the 3 round hashes are validated against a zero length input string.

Git
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 09:45.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )