473,657 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hash code generating algorithm.

I am trying to provide some security to text files, by adding a
signature
at the end of each text file.
this signature needs to be generated by some kind of
hashing algorithm. so while sending the file,
i will sign the text file and at the receiving end,
the text file will be checked to make sure
that the hash code matches.
( not that it matters for this but my environment is c++ in vs.net2003)
any ideas about what kind of hash algorithm i could use ?
thanks in advance.

Nov 17 '06 #1
5 2074
"lavu" <th******@yahoo .comwrote in message
news:11******** *************@j 44g2000cwa.goog legroups.com...
>I am trying to provide some security to text files, by adding a
signature
at the end of each text file.
this signature needs to be generated by some kind of
hashing algorithm. so while sending the file,
i will sign the text file and at the receiving end,
the text file will be checked to make sure
that the hash code matches.
( not that it matters for this but my environment is c++ in vs.net2003)
any ideas about what kind of hash algorithm i could use ?
thanks in advance.
Hashes and digital signatures are not the same. Loosely, a signature on a
message is string which is the value of the hash of a message encrypted with
the signer's private key.

So the first thing you need to do is to decide whether you want a signature
or a hash. Just by the way, signatures usually imply the presence of a whole
infrastructure with a trusted "certificat e authority".

Popular hash algorithms go by the name of SHA-1 (secure hash #1) and MD5
(message digest #5). Google is your friend.

Cryptography is a huge and hard-to-grok topic. You might want to start
reading here:

http://msdn2.microsoft.com/en-us/library/aa382450.aspx

or here

http://www.eskimo.com/~weidai/cryptlib.html

Regards,
Will
Nov 17 '06 #2

"William DePalo [MVP VC++]" <wi***********@ mvps.orgwrote in message
news:Os******** ******@TK2MSFTN GP02.phx.gbl...
"lavu" <th******@yahoo .comwrote in message
news:11******** *************@j 44g2000cwa.goog legroups.com...
>>I am trying to provide some security to text files, by adding a
signature
at the end of each text file.
this signature needs to be generated by some kind of
hashing algorithm. so while sending the file,
i will sign the text file and at the receiving end,
the text file will be checked to make sure
that the hash code matches.
( not that it matters for this but my environment is c++ in vs.net2003)
any ideas about what kind of hash algorithm i could use ?
thanks in advance.

Hashes and digital signatures are not the same. Loosely, a signature on a
message is string which is the value of the hash of a message encrypted
with the signer's private key.

So the first thing you need to do is to decide whether you want a
signature or a hash. Just by the way, signatures usually imply the
presence of a whole infrastructure with a trusted "certificat e authority".

Popular hash algorithms go by the name of SHA-1 (secure hash #1) and MD5
(message digest #5). Google is your friend.
MD5 is considered to be broken... MD4 was broken and the same mathematical
features weaken MD5, making certain attacks feasible using modern computing
systems.
>
Cryptography is a huge and hard-to-grok topic. You might want to start
reading here:

http://msdn2.microsoft.com/en-us/library/aa382450.aspx

or here

http://www.eskimo.com/~weidai/cryptlib.html

Regards,
Will

Nov 20 '06 #3
"Ben Voigt" <rb*@nospam.nos pamwrote in message
news:e8******** *****@TK2MSFTNG P02.phx.gbl...
MD5 is considered to be broken... MD4 was broken and the same mathematical
features weaken MD5, making certain attacks feasible using modern
computing systems.
And for that matter so is SHA-1:

http://www.schneier.com/blog/archive...a1_broken.html

The devil, though, is in the details. Whether the "collision attack"
vulnerability in SHA-1 or a vulnerability in any other algorithm is
significant depends a lot on what one wants to do, the resources one wishes
to expend, and the resources of those who might want to crack one's
security.

Chances are that if someone is posting a question _here_ the security
provided by either MD-5 or SHA-1 (assuming the OP just needs a hash
function) would suffice.

Regards,
Will
Nov 20 '06 #4

Thanku for giving me something to begin with. Looks like I have a lot
of reading about hash code and digital signatures.
I was told to create an ecncrypted hash code that can be appended to
the file to be secured. Sounds simple but looks like I have quite some
ways to go. My journey begins now......

Nov 20 '06 #5

"lavu" <th******@yahoo .comwrote in message
news:11******** *************@h 48g2000cwc.goog legroups.com...
>
Thanku for giving me something to begin with. Looks like I have a lot
of reading about hash code and digital signatures.
I was told to create an ecncrypted hash code that can be appended to
the file to be secured. Sounds simple but looks like I have quite some
ways to go. My journey begins now......
Rather than searching for hash code or digital signature, try "message
authentication code".
Nov 20 '06 #6

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

Similar topics

34
14463
by: pembed2003 | last post by:
Hi All, Does C++/STL have hashtable where I can do stuff like: Hashtable h<int>; h.store("one",1); h.store("two",2); and then later retrieve them like:
0
5156
by: Dil via .NET 247 | last post by:
Fresher to .NET Aiming to produce a resulting hash of length 24 CHARACTERS, using MD5 or SHA1 Algorithms. According to the Class Libraries, the hash size for the SHA1 algorithm is 160 bits, and 128 bits for MD5. After generating the hash, I convert the byte result to a base64 String, and my resulting hash lengths are as below: MD5 - 24 characters SHA1 - 28 Characters
10
2441
by: Qiangning Hong | last post by:
I'm writing a spider. I have millions of urls in a table (mysql) to check if a url has already been fetched. To check fast, I am considering to add a "hash" column in the table, make it a unique key, and use the following sql statement: insert ignore into urls (url, hash) values (newurl, hash_of_newurl) to add new url. I believe this will be faster than making the "url" column unique key and doing string comparation. Right?
1
3591
by: Wayne Deleersnyder | last post by:
Hi All, I was going to write and ask if someone could help me fix the formatting of my output for hash values, but I believe I got it right now. But, because I couldn't find any website or tutorial to help me with this issue I figured I'd make a post just in case someone else runs into the same issue. ....
3
2941
FishVal
by: FishVal | last post by:
Hi everyone. I need a good idea. I'm developing database (Access2003, WinXP SP2) for documents storing. It is expected that documents will be in PDF format. Particulary I'm meaning scietific articles, patents, technical documents etc. Obviously I should implement a mechanism preventing files duplicating. A part of it will be generating hash code uniquely identifying file content.
139
14138
by: ravi | last post by:
Hi can anybody tell me that which ds will be best suited to implement a hash table in C/C++ thanx. in advanced
15
37580
by: Ashish Khandelwal | last post by:
As MSDN is not giving us guarantee upon uniqueness of Hash Code, so could any one suggest me that how to generate a unique Hash Code for same string always, and generate different-2 Hash Code Different-2 string.
6
10035
by: j1mb0jay | last post by:
I am currently working on a dictionary populating program. I currently have a socket connection my local news server and am trawling through all of the articles looking for new words. I am currently using Java to do this but would like to move the source to C#. Java's String class has a method that hashes strings. I was wondering if C# has a method which does the same? In my Java version of the program I am using the Multiply Add and...
4
3459
by: macm | last post by:
Hi Folks I tested <?php echo 'sha256=>' .hash('sha256', 'The quick brown fox jumped over the lazy dog.') .'</br>'; echo 'sha384=>' .hash('sha384', 'The quick brown fox jumped over the lazy dog.') .'</br>'; echo 'sha512=>' .hash('sha512', 'The quick brown fox jumped over the
0
8394
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
8306
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
8825
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
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.