473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

SHA-1 in microsoft visual basics for 160bit message digest

can any one of youll write a code in microsoft Visual basics for secure Hash algorithm please see additional information below (this is for my final year project)

ALGORITHM
 Append padding bits : The message length should be congruent to 448 mod 512.Padding is always added even if the msg is already of the desired length.Padding consists of a single 1-bit followed by the necessary number of 0-bits.
 Append length : A block of 64-bits is appended to the message. This block is an unsigned 64-bit integer (most significant byte first) and contains the length of the original message before padding.
 Initialize MD buffer : A 160-bit buffer is used to hold intermediate and final results of the hash function.The buffer is represented as five 32-bit registers(A,B,C,D,E).These registers are initialized to the following 32-bit hexadecimal values.
A=67452301
B=EFCDAB8
C=98BADCFE
D=10325476
E=C3D2E1F0
In SHA-1 these values are stored in big endian format which is the most significant byte of the word in the low address byte position.
 Process message in 512-bit blocks : The heart of the algorithm is a module that consists of 4 rounds of processing of 20 steps each,i.e. a total of 80 steps.The 4 rounds have similar structure but use different logical functions(f1,f2,f3,f4).Each round takes as input the current 512-bit block being processed (Yq) and 160-bit buffer value (A,B,C,D,E) and updates the contents of the buffer.Each round also makes use of an additive constant Kt, where 0<=t<=79.
kt =5A827999
kt =6ED9EBA1
kt =8F1BBCDC
kt =CA62C1D6

Processing of a single 512-bit block



SHA-1 Compression Function
 ft =>takes 3words(B,C,D) of 32-bit each and performs bitwise logical operations. The output is a 32-bit word.
Step function name function value
0<=t<=19 f1 =f(t,B,C,D) (B/\C)\/(B’/\D)
20<=t<=39 f2=f(t,B,C,D) B xor C xor D
40<=t<=59 f3 =f(t,B,C,D) (B/\C)\/(B/\D)\/(C/\D)
60<=t<=79 f4 =f(t,B,C,D) B xor C xor D


 Output : After all 512-bit blocks have been processed ,the output from the last stage is the 160-bit message digest.
Mar 30 '07 #1
0 1540

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Marco Herrn | last post by:
Hi, I don't know wether this is really the best place for asking this question. If you know a better, please tell me. The problem is an understanding of the 3 modules for hash algorithms. I need...
28
by: Paul Rubin | last post by:
http://www.nightsong.com/phr/python/sharandom.c This is intended to be less predicable/have fewer correlations than the default Mersenne Twister or Wichmann-Hill generators. Comments are...
4
by: Florian Lindner | last post by:
Hello, I try to compute SHA hashes for different files: for root, dirs, files in os.walk(sys.argv): for file in files: path = os.path.join(root, file) print path f = open(path) sha =...
4
by: Ravi Singh (UCSD) | last post by:
Hello all I am trying to compare the SHA 256 algorithm as implemented by Christophe Devine and on using the .NET "SHA256Managed" but they do not give me similar hashes. Here is the...
0
by: rene.rugerio | last post by:
I am developing an application using dot net fw 2.0 I am using the signedcms for the digital signature. I certainly do not understand why this generates long string as a result of the signing,...
3
by: mirandacascade | last post by:
Operating system: Win XP Vsn of Python: 2.4 Situation is this: Required to calcluate a message digest. The process for calcluating the digest must use an SHA-256 algorithm. Questions: 1) Is...
1
by: David Rees | last post by:
The Forms-encryption module includes a handy (if long-winded) hash function: FormsAuthentication.HashPasswordForStoringInConfigFile It only supports MD5 and SHA1, but ages ago MD5 was torn apart,...
0
by: Antony Clements | last post by:
I can't find one anywhere on the net and my skills are lacking in that particular area of coding. The closest I can find is a truncated version of SHA-384 that someone is trying to pass off as...
18
by: Tomás Ó hÉilidhe | last post by:
(SHA-1 is a cryptographic hash function. For info on what SHA-1 is: http://en.wikipedia.org/wiki/SHA-1) I'm writing fullportable C89 code that needs to make use of the SHA-1 algorithm. Does...
12
by: gulyan | last post by:
Hi, I'm trying to make the sha-1 algorithm based on the wikipedia pseudocode. For the 'The quick brown fox jumps over the lazy dog" string I should get 2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.