473,809 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SHA 256 .NET vs FIPS-180-2 compliant SHA-256

Hello all
I am trying to compare the SHA 256 algorithm as implemented by
Christophe Devine and on using the .NET "SHA256Mana ged" but they do not
give me similar hashes.
Here is the Christophes implementation .
http://www.cr0.net:8040/code/crypto/sha256/
In .NET
SHA256Managed sha256 = new SHA256Managed() ;
sha256.ComputeH ash( Encoding.ASCII. GetBytes("jonny ") );
but I do not get similar hashes. Any ideas?
Thanks
Ravi Singh

Nov 16 '05 #1
4 6778
Ravi Singh (UCSD) <ra*********@gm ail.com> wrote:
I am trying to compare the SHA 256 algorithm as implemented by
Christophe Devine and on using the .NET "SHA256Mana ged" but they do not
give me similar hashes.
Here is the Christophes implementation .
http://www.cr0.net:8040/code/crypto/sha256/
In .NET
SHA256Managed sha256 = new SHA256Managed() ;
sha256.ComputeH ash( Encoding.ASCII. GetBytes("jonny ") );
but I do not get similar hashes. Any ideas?


Well, the two test strings in the C source seem to give the expected
results... what are you getting as the hash from each?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Thank you for replying .

7a29dc9b52b3e44 eef25e044185332 4c97489f5e626fc 1aa97e4ede646b5 0a45 ---
thats with the FIPS-180-2 compliant SHA-256 Christophes implementation

0fae56d5786cade 88b348cf55a9e4a 217406ff5359e51 7cddf9fea2bb686 ea6f on
..NET C# after converting it to a HEX string.

is C# not FIPS-180-2 compliant or is there some other problem.
Ravi Singh.

Nov 16 '05 #3
Ravi Singh (UCSD) <ra*********@gm ail.com> wrote:
Thank you for replying .

7a29dc9b52b3e44 eef25e044185332 4c97489f5e626fc 1aa97e4ede646b5 0a45 ---
thats with the FIPS-180-2 compliant SHA-256 Christophes implementation

0fae56d5786cade 88b348cf55a9e4a 217406ff5359e51 7cddf9fea2bb686 ea6f on
.NET C# after converting it to a HEX string.

is C# not FIPS-180-2 compliant or is there some other problem.
Ravi Singh.


Having compiled the C code myself now, I'm getting the same result as
..NET is (ie 0fae...)

It looks like you're doing something wrong on the C side.

(I tested it by just taking the sample code, adding "jonny" as an extra
test, and making it print out the output of the test.)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
Thank you very much for your time and answers, it seems the error was
on my side. My understanding of the FIPS-180-2 spec was a little off.
Ravi Singh.

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

822
29877
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical real-time applications. The majority of expert/people recommend Ada for safety critical real-time applications. I've many years of experience in C/C++ (and Delphi) but no Ada knowledge. May I ask if it is too difficult to move from C/C++ to Ada?...
7
1647
by: datapro01 | last post by:
Hello, I am using the following: DB2 UDB V8.1.1 AIX 5L I need to know if there is a way to set up a table so that a particular group has read access to all of the rows in the table and update authority to only one of the columns in the rows. Any help will be appreciated.
0
1781
by: Vlad# | last post by:
Hi, I wanted to try out some development for the Windows CE 5.0 platform so downloaded the SmartPhone SDK from Microsoft and started up a new project with a blank form. This is virtually a blank project, I will want to do some networking when I get the program to compile though. I am using Visual Studio 2005 RTM (Target is set to Windows Mobile 5.0 SmartPhone Emulator) The build error I get is this:
2
1865
by: David Boone | last post by:
I've been trying to create functions with postgres, but it seems that queries run within a function take wayyy too long to complete. The increased time seems to be in the actual queries, not function call overhead or something, but I can't for the life of me figure out why it's slower like this. I've simplified it to what you see below. Any insight would be *much* appreciated. Thanks! - Dave
2
2386
by: Gregory S. Williamson | last post by:
Dear peoples, I've got a problem which seemed to be neatly solved by the use of schemas, and in fact it mostly works, but I have tried to go one step too far, perhaps. Rather than have the application do SET search_path TO f12057; SELECT * FROM parcel-owners WHERE ... ; SET search_path TO public;
13
2435
by: lnzju | last post by:
I mean to write the DES Algorithm myself.
1
1812
by: ssgame | last post by:
I am trying to create my first ASP.NET 2.0 application but keep getting this error, no matter if there is nothing in the code other than that created in the original files. "This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms." I am using VS 2005 and can't get anything to be viewable in the browser. Any help?
0
1006
by: piglet | last post by:
Hi! I try to pull out data from three tables, and face a problem. Here is my query: SELECT Census2000_1.GEO2000, .FIPS, SUM(2003_Full].DEPSUMBR) AS TOTAL, V032006.GEO2000 AS V032006 FROM FULL OUTER JOIN Census2000_1 ON FDIC.dbo..FIPS = Census2000_1.GEO2000
1
1295
by: drtitus7759 | last post by:
I'm having difficulty in generating a query the way we need it. I have a the following tables: Segment Master: Project FIPS Segment Production: Project Yr
10
7839
by: Iwan Budihalim | last post by:
Who can help? I'm trying to implement an encrypted (plain text) communication between a Delphi application and an ASP.NET. My choice is AES/rijndael-128. For both sides, i use standard modules: Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component Library v2) from cityinthesky (www.cityinthesky.com) ASP.NET : Standard library of Rijndael both sides are working, BUT they do different! The results in encryption
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.