Sponsored Content
Full Discussion: SHA1 hash calculation
Top Forums Programming SHA1 hash calculation Post 302434221 by ahsaas42 on Thursday 1st of July 2010 11:41:17 PM
Old 07-02-2010
SHA1 hash calculation

hi

i want to generate SHA1 hash of string in Linux (atmark) and downloaded the XYSSL-0.9 version code for the same.i have the algorithm which takes file as argument and returns hash of file . And of same file while I generated the key using online tools then it doesn't match with my compiled library's result.
Do I need to change anything for it while compiling.
Secondly the data is equivalent to while doing memcpy in function rsa_pkcs1_verify(). In this func len is 35 and hasd_id is RSA_SHA1.

is there any conversion required on string before giving to hash generator???
if yes in which form its required??

Thanks,
 

10 More Discussions You Might Find Interesting

1. Programming

MD5 hash calculation

hi i want to generate MD5 hash of string in unix (hp) i have the algorithm which takes file as argument and returns hash of file but when i tried to generate hash of "a" result was "60b725f10c9c85c70d97880dfe8191b3" hash but actually it should have been "0cc175b9c0f1b6a831c399e269772661" now i... (4 Replies)
Discussion started by: zedex
4 Replies

2. Shell Programming and Scripting

Print Entire hash list (hash of hashes)

I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes). Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash. Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies

3. Shell Programming and Scripting

parse csv file, sha1 hash and output

I have a file, not really a csv, but containing delineated data just the same. Lets call that file "raw_data.txt". It contains data in the format of company name:fein number like this: first company name:123456789 second company name:987654321 what i need to do is read this file, apply... (11 Replies)
Discussion started by: FreddyG
11 Replies

4. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below. #!/usr/bin/perl use warnings; use Tie::IxHash; use strict; tie (my %programs, "Tie::IxHash"); while (my $line = <DATA>) { chomp $line; my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies

5. Shell Programming and Scripting

perl hash - using a range as a hash key.

Hi, In Perl, is it possible to use a range of numbers with '..' as a key in a hash? Something in like: %hash = ( '768..1536' => '1G', '1537..2560' => '2G' ); That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies

6. Shell Programming and Scripting

sha1 question

What is the unix shell scripting equivalent of the following php code? I have tried to reproduce it, but I haven't been able to. <?php sha1(sha1(strtolower($user) . $pass) . $sessionid); ?> (12 Replies)
Discussion started by: locoroco
12 Replies

7. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

Hi, I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all . my %result ( $abc => { 'data_count' => '10', 'ID' => 'ABC122', } $def => { 'data_count' => '20', 'ID' => 'defASe', ... (1 Reply)
Discussion started by: asak
1 Replies

8. Shell Programming and Scripting

Dynamically parse BibTeX and create hash of hash

Hello gurus, Iam trying to parse following BibTex file (bibliography.bib): @book{Lee2000a, abstract = {Abstract goes here}, author = {Lee, Wenke and Stolfo, Salvatore J}, title = {{Data mining approaches for intrusion detection}}, year = {2000} } @article{Forrest1996, abstract =... (0 Replies)
Discussion started by: wakatana
0 Replies

9. Shell Programming and Scripting

Need to print hash of hash in table format

Hi, I have a hash of hash where it has name, activities and count i have data like this - $result->{$name}->{$activities} = $value; content of that are - name - robert tom cat peter activities - running, eating, sleeping , drinking, work i need to print output as below ... (3 Replies)
Discussion started by: asak
3 Replies

10. OS X (Apple)

SHA1 verification script

Hi guys! Me again! ... I'm trying to build (on MacOS directly) a bash script that will help me verify a SHA1 digest (to verify downloads and so on and so forth). So first off, here's my version of BASH under OSX: bash-4.4$ And here's my version of Sierra (macOS): 10.12.3 (16D32) ... (2 Replies)
Discussion started by: Ardzii
2 Replies
HASH(9) 						   BSD Kernel Developer's Manual						   HASH(9)

NAME
hash, hash32_buf, hash32_str, hash32_strn -- kernel hash functions SYNOPSIS
#include <sys/types.h> #include <sys/hash.h> uint32_t hash32_buf(const void *buf, size_t len, uint32_t ihash); uint32_t hash32_str(const void *buf, uint32_t ihash); uint32_t hash32_strn(const void *buf, size_t len, uint32_t ihash); DESCRIPTION
The hash functions returns a hash of the given buffer. The hash32_buf() function returns a 32 bit hash of buf, which is len bytes long, seeded with an initial hash of ihash (which is usually HASH32_BUF_INIT). This function may use a different algorithm to hash32_str() and hash32_strn(). The hash32_str() function returns a 32 bit hash of buf, which is a NUL terminated ASCII string, seeded with an initial hash of ihash (which is usually HASH32_STR_INIT). This function must use the same algorithm as hash32_strn(), so that the same data returns the same hash. The hash32_strn() function returns a 32 bit hash of buf, which is a NUL terminated ASCII string, up to a maximum of len bytes, seeded with an initial hash of ihash (which is usually HASH32_STR_INIT). This function must use the same algorithm as hash32_str(), so that the same data returns the same hash. The ihash parameter is provided to allow for incremental hashing by allowing successive calls to use a previous hash value. RETURN VALUES
The hash32_* functions return a 32 bit hash of the provided buffer. HISTORY
The kernel hashing API first appeared in NetBSD 1.6. BSD
December 5, 2001 BSD
All times are GMT -4. The time now is 02:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy