Click here to Skip to main content
15,892,005 members
Everything / Hash

Hash

hash

Great Reads

by Marc Clifton
An interactive demo of how audit and consistency proofs work
by Bruno van Dooren
This article describes a way to hash data using the latest Win32 API and C++
by phil.o
C# implementation of sponge construction and SHA-3 hashing operations
by Vasil Trifonov
Compare two DLL files programmatically using hash

Latest Articles

by Bruno van Dooren
This article describes a way to hash data using the latest Win32 API and C++
by honey the codewitch
Get your data on, even on platforms without a reliable STL implementation using these simple but critical classes.
by Sanmayce
Brutally optimized hash function for general table lookups
by DiponRoy
Create hash and compare

All Articles

Sort by Updated

Hash 

22 Nov 2016 by A7lam Lover
i'm making a file's hashing app using a (HashLib++) but when i test the (Library) with the Qt Creator it gives me an errorhere is the pic of the errors$Screenshot 148.png - Google Drive[^]honestly i don't know what's make this errori tried many things but no luckWhat I have...
11 Apr 2020 by AbdelrahmanNassar
public int hashKey(String str){ int sum = 0; int exp = 1; for(int i = 0; i
2 Apr 2013 by AdiCivils
I'm creating a HashMap. While creating it, I can see that keys are assigned proper distinct values, but, after creation, when I iterate it, all the keys are yielding only one value. Below is my code: public void prepareAccountMap(HashMap masterMap, GAReadConfigType config,...
2 Apr 2013 by AdiCivils
I've solved it!! Had to create a new object for every bean.....
14 Feb 2016 by adriancs, Taylor Hornby
Securing Password by Hashing with Salt
30 Oct 2013 by Aescleal
Try using std::map first. Yep, the performance is rubbish but often you can't tell the difference between optimal and rubbish when you've got a small number of things (less than thousands) to choose between. Another thing you might want to try is std::unordered_map as you can then write portable...
11 Jan 2012 by Andrew Rissing
To start off, I'll have to admit I've never tried something like this, but I think I can direct you a bit. If you have a Hashtable (or even a Dictionary), they store values on a 1:1 basis (i.e. one key, one value).So, the only way to approach this problem as you've stated it without...
2 May 2012 by Anele Ngqandu
Hi HuysWhat is the most secure hashing algorithm used?
20 Mar 2020 by Asish6542165
I wrote a c program to perform sha256 hash on a char array and then perform ripemd160 hash on the output of the sha256 hash function. here is my code: #include #include #include #include
27 Mar 2020 by Asish6542165
I have a function that returns a bitcoin address but I want to perform base58check encoding on it to convert it to a bitcoin address. unsigned char address[]="008f26a17cbbc941a9dbe63a1f1c69591f08aab94bd586ad5e" The address is stored in an...
6 Mar 2014 by atul sharma 5126
Hello,I am trying to convert the password into hash value to further save and then match it for login. But while coding itself the above error is showing. This is my first time at hashing. Thanks in advance.error is at line: Dim tmpSource As Byte =...
11 Jun 2022 by Ayesha Tassaduq
Hi I am a beginner in python and I am working on the blockchain I want to store any hash that creates by any transaction. I want to transfer that hash to a local database. Can anyone tell me how can I do that? Here is my code. can anyone give me...
7 May 2016 by BladeLogan
I am currently working on a project and my friend told me what I need to do to progress but he didnt tell me how to so now im staring into the screen without knowing what to do.This is what he saidWithin your click handler you can call functions. So why not add thatfunction to your...
7 May 2016 by BladeLogan
Here is what I came to conclusion with Thanks to OrigianalGriff//---------------I STILL DONT UDNERSTAND WHAT THESE LINES DO--------------------public string MD5HashFile(string fn){ byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes(fn)); return...
13 Sep 2012 by BrianHamilton
Hi, I have the following program working which will prove MD5 collisions for various files containing slightly different data. However, when I create the files using proven collision data from wikipedia http://en.wikipedia.org/wiki/Md5[^]I get hashes that do not match and neither of them match...
26 Aug 2022 by Bruno van Dooren
This article describes a way to hash data using the latest Win32 API and C++
30 Oct 2013 by Buddhi Chaturanga
Firstly,I want to inform you that my overall/main target is to execute certain functions using their function name(string) as an argument,I defined a function as below: (I want to generate a unique number for each string data that I inserted as argument to a function).#include ...
17 May 2018 by Chillin92
Currently, my project is using Hmac-SHA256 to do the authorization in APIM. We are struggle with how to generate, transmit and store the secret key between client side and ours. Is there any secure way to do this? What I have tried: For now, we are generating the secret key through openssl...
28 Mar 2012 by Code Master38
I was wondering is there a way to calculate the old LM hashes for windows in .net? I have looked all over and found nothing on Google, however I found Ophcrack generates them and I'm wondering how?I have to find a way to generate them as a homework assignment, so any help would be nice!
27 Jun 2013 by coder-project-name
I have a DB where I am not allowed to change the schema and the tables do not have last mod time in them. I need to query this DB data daily and check if there are any rows that changed. I thought combining the columns and hashing it with one of the columns also as key of hash, and write the...
14 Mar 2014 by CPallini
In this CodeProject article you may find: "Hash Functions: An Empirical Comparison"[^].
19 May 2014 by CPallini
Couldn't you just declare hash as Int64 and clear the upper part when needed?
3 Dec 2016 by CPallini
Assuming it is not homework, you should use std::unordered_map[^].
24 Mar 2020 by CPallini
Quote: how can I programmatically convert this Each character (say c) of the input string represent a nibble. The value of the nibble is given by if ( c >= '0' && c ='a' && c
13 Apr 2022 by CPallini
Each hash item should be a node of a linked list, instead of plain integer, e.g. struct HashItem { int id; char * name; HashItem * next; }; See, for instance Hash table - Wikipedia - Collision resolution[^]. If you can, use C++, the...
21 Apr 2014 by DamithSL
Generates a random password, assigns it to the user account, sends an email informing the user of their new password- http://www.asp.net/web-forms/tutorials/security/admin/recovering-and-changing-passwords-cs[^]-...
8 May 2014 by David A. Gray
As Sergay said, it depends on your system and code. For instance, I have Ronald Rivest's code, written in straight C, that hashes 1 block in X nanoseconds. Since I haven't done any benchmarks, I can't tell you the value of X. I used Microsoft Visual C++ 6.0 to compile it into the DLL that I use...
13 Nov 2012 by David Cabrea
how I can get my application to work like that gmail adding and reading the # in the urlHelp please
23 Aug 2014 by demoninside9
Hi All,I am saving hash password and sal password in db.But when I trying to retrieve password, the password doesn't match. why. below is my code.Creating Userprotected void Create_User() { try { string salt = GenerateSalt(); ...
29 Mar 2021 by deXo-fan
Hello, I wrote a program in C with the Win32 API that could, or was supposed to, be able to generate correct hashes for an input message. The algorithms to be used were all one-way, such as MD2, MD4, MD5, and SHA-1. These are the ones I tested,...
26 Jun 2019 by DiponRoy
Create hash and compare
19 Jun 2012 by Dominik Reichl
CSHA1 - A C++ class implementation of the SHA-1 hash algorithm
19 Dec 2014 by Enda Phelan
I am trying to insert my hashed password into my database. I am using a BCrypt function to hash the password:#region Password Hash w/ BCrypt private static string GetRandomSalt() { return BCryptHelper.GenerateSalt(12); } public static string...
9 Dec 2015 by F-ES Sitecore
I'd advise you to first learn and understand what it is you're trying to do;https://crackstation.net/hashing-security.htm[^]The above link has c# examples, and there are other examples too if you google "c# hash passwords with salt".Second of all you're passing the result of a bool...
18 Jul 2019 by F-ES Sitecore
If you are sending the encrypted credentials then that will never expire as long as the account is valid. If you want the logins to expire you'll need to generate a token that the client can use and that token will have an expiry date.
23 Dec 2012 by FreaKyboard
I need to encode the sending messages/data(not MD5)and then they will be decoded on the other side. Codes have to be in android libraries not in java. Is there any code or information that may help me around internet? Thx all for your help.
17 Jun 2012 by Giggsey73
Hi guys. I am just wondering how it is possible to create two new colliding md5 executable files? In other words, both files have the same hash values.Appreciate it. Thanks.
6 Aug 2012 by Giggsey73
Hi All. I have designed my own hash calculator prototype. I need to come up with file type of different sizes eg. 100KB, 10MB, 100MB, 1GB, etc in order to test the prototype. So, I created the dummy files for these sizes using Dummy File Creator. I tested hashing the real file and hashing the...
18 Jul 2012 by graybin
Basically, I would like to create a hash table that looks like:{"ClassNumber" = $ClassNumber; "Student" = @($Student1,$Student2,...$Studentx)}I would like to be able to add the ClassNumber, with a Student, then continue to add Students to the Student array one at a time, while leaving the...
18 Jul 2012 by graybin
I am not familiar with .Net objects, and was hoping to do it purely in powershell.
23 Jul 2012 by graybin
PS > $hash = @{}PS > $hash['class1'] = @('student1')PS > $hash['class1'] += 'student2'PS > $hashName Value---- -----class1 {student1, student2}
5 Jun 2021 by Greg Utas
A segmentation fault means that you're using a bad pointer, so you need to run your code with a debugger. It's very unlikely that you will find anyone on this site to inspect your code, looking for the bug, or actually debug it for you. Maybe...
21 Apr 2014 by Guruprasad.K.Basavaraju
Encrypt using the master key..-- Create database KeyUSE Hassan_Web_Project_DB;GOCREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Password123';GO-- Create self signed certificateUSE Hassan_Web_Project_DB;GOCREATE CERTIFICATE Certificate1WITH SUBJECT = 'Protect...
25 Apr 2015 by HeinrichRichardSonButt
I am trying to generate the HMAC SHA1 Hash to use the Railway PNR API[^].I am using PHP Framework Codeigniter.I used the helper given here.Then I tried to generate the hash and compare it with the Hash Generator[^] given in the Rail PNR API site.But both the hash i.e. the one I generated...
25 Apr 2015 by HeinrichRichardSonButt
The values that are to be passed in the API is supposed to be in the alphabetical order. Like in my case above, if we arrange the keys in alphabetical order the keys will be: format, pbapisign (i.e. the public key) and pnr.So the string to be hashed will be 'json'.'
31 May 2015 by Herboren
making hash compare utility and I am using an if statement to compare a generated hash to a list of hashes held in a text file. I works flawlessly with the exception of not adding "false" to the listview as a subitem, a blank " " implies false, that the items do not match, which is what I am...
31 May 2015 by Herboren
Took both SA and Gustafson advice. Thank you guys, The code below appears to workprivate void compareToolStripMenuItem_Click(object sender, EventArgs e) { string[] hashEntries = File.ReadAllLines(dlgFile.FileName); try { if...
16 Mar 2022 by honey the codewitch
Get your data on, even on platforms without a reliable STL implementation using these simple but critical classes.
29 Sep 2015 by HP2M
This tip covers handling two Excel lists using Interop.
9 Oct 2023 by HughJass24
As suggested by the title, I'm working on an exercise where I'm given a hash function H that takes in an input string x. I'm supposed to construct a distinguisher that proves H isn't collision-resistant. I'm given a block cipher F, F^-1 as well....
14 Mar 2014 by Jacob Himes
Hi,I was wondering if there is any hashing algorithm faster than SHA1. I'll be clear, I'M NOT USING THIS FOR SECURITY. I'm just using it for equality checks internally at a low-level. So far I'm happy with SHA1 but I want to see if I can go faster without dissecting Google.Thanks.
22 Nov 2016 by Jochen Arndt
Please don't post external links to images. You only have a few lines of code and an error message that can be posted here.If you had done that I would be able to copy and paste the code into my answer showing you how to solve the problem. But so you will only get a textual answer.The...
5 Jun 2018 by Jochen Arndt
Why do you open the file twice? As a result you will have two handles to the same file but only one will be closed because f holds internally the handle of the second call while the first handle is not accessible anmyore. Let the line where you declare (Dim) and assign f in place and remove...
29 Oct 2019 by John M. Dlugosz
I recall this series of videos on YouTube: Let's make 16 games in C++/SFML! - YouTube[^] There is also this series from OneLoneCoder: Code-It-Yourself! - YouTube[^]
19 May 2014 by Jörgen Andersson
The classic function in C# to create a hash value from an array looks like this or similar:public int GetHashCode(T[] array) { unchecked { if (array == null) { return 0; } int hash = 17; ...
20 May 2014 by Jörgen Andersson
For future reference, this is how my solution looks like: Public Overrides Function GetHashCode() As Integer Dim hash As Int64 = 19 For Each Item As T In Me hash = hash * 31 + Item.GetHashCode hash = ((hash > 32) + hash >>...
12 Oct 2018 by k5054
Are you trying to dynamically adjust the size of your table variable? e.g. something like int get_int(void); // read an int from the user - not a standard function! int capacity; struct person table[capacity]; // more code here ... capacity = get_int(); for(int i = 0; i
2 Jan 2022 by KarstenK
You need to hash all data of any class object. And you need to overwrite it in every class which you are designing to get a unique hash. The C++ vector has already some hash support. If a hash isnt unique - it isnt a hash. There is no way...
12 Apr 2022 by KarstenK
The hash is to weak, so you need some better hashing algorithms, take a lot at these proven hash functions. At least you will see that your function is way to simple for that problem.
2 Jun 2014 by Keith Barrow
If you follow your original link[^], go to the "Methods" section and click "Create()" you are taken to the information about the Create method: here[^].The page states "By default, this overload uses the SHA1CryptoServiceProvider ", so the default provider is SHA-1[^].
6 Apr 2023 by Kostiuchenko Diana
I need to test if my hash table works right, but it fails the test as my hash table doesn't seem to find any elements. No problems in compiler, neither through debugger, it's somewhere in the logic of the code. I thought it's because of insert()...
28 Mar 2012 by Kschuler
Code Master123 wrote:I have looked all over and found nothing on GoogleWhat did you search for? Because I googled[^] and found all kinds of downloads for classes that are supposed to do the LM hash. I also found This link[^] that posts code directly. And a good explaination on...
23 Jul 2015 by kubibay
I'm trying to use elastic transcoder of Amazon. Here I need to sha-256 hash a string; http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.htmlI have tried any ways I have found on the net but I couldn't find the same result as page and some online hashing sites...
23 Jul 2015 by kubibay
Removing \r was the solutions = s.Replace("\r", "");
30 Oct 2019 by Kyudos
I have a set of nodes (N) arranged into one or more networks. Each network has one or more root nodes. Each node has a unique ID (UID) that is a 32-bit integer. If there were 100,000 nodes that would be a large problem - 1,000,000 would be almost infeasibly gigantic. I need to check if all nodes...
21 Mar 2023 by LB2371
I'm implementing a CSRF protection system for my website (forms) and I've noticed a strange (?) thing using hash_equals + crypt. An example to explain it (PHP 8.1.8): $sessionToken = crypt(“562710df09d5b3b1e33769cd50a7e15d0cad770e66771ebbe9”,...
18 Jul 2012 by lewax00
So then what's the problem? Any reason you can't use Dictionary[^] or Hashtable[^]? As far as I know, you can use .Net objects in PowerShell.
6 Aug 2012 by lewax00
First, there's no reason hashing a dummy file would be unsafe, nor would it be impractical for testing purposes. As for the difference in time, it's hard to say. If the hashing algorithm changes it's behavior based on the contents of the file (e.g. if the last bit of a block is 0 do A, if...
10 Feb 2022 by M Imran Ansari
In order to use a non-static field, method, or property, you must first create an object of an instance. HashAlgorithm hashAlgo = HashAlgorithm.Create("SHA512"); Now use the object hashAlgo to call their methods. Reference for more information:...
3 Apr 2019 by Mahsa Hassankashi
Best approach for having more secure channel to transfer user information throughout the web
21 Apr 2014 by Manas Bhardwaj
Well, my suggestion would be not to implement the Forgot Password by sending their password as plain text in email.I would rather extend Forgot Password as Reset Password. Thus, if you forget your password you are forced to reset your password.And this is standard and more secure...
13 Mar 2017 by Marc Clifton
An interactive demo of how audit and consistency proofs work
18 Nov 2016 by Masoud__Sh
Please help me; I can't describe which algorithm is better?What I have tried:Hi,i have read this article:Salted Password Hashing - Doing it Right[^]and i understand that the best hash algorithm for asp.net webforms is PBKDF2-HMAC-SHA512and then get this...
21 Dec 2018 by Mehdi Gholam
Read this : Bloom filter - Wikipedia[^]
19 Feb 2019 by Mehdi Gholam
If you need to check for the existence or lack there of something in a list and you don't have the memory capacity or it is infeasible to store use Bloom filter - Wikipedia[^] . Bloom filters will give you a definite negative if it is not encoded in the bloom bits, and a probable positive for...
15 Aug 2015 by Member 11238028
This implementation of strstr uses hashing, the choice of hash function below is obviously not perfect, that's why I want to improve it; the full program is the following:#include #include const char *strstr(const char *str1, const char *str2){ unsigned...
19 Nov 2015 by Member 12154285
I have been struggling with one of my homework questions for quite some time. I am attempting to implement a getLocation(hash1, x) method, which finds the location of the entry with key x. If such an entry does not exist, it returns the location where a new entry with key x should be stored. The...
3 Dec 2016 by Member 12812147
Hi, I'm trying to hash english words from a txt file and store them in a table using chaining method . but i don't know what is wrong when i try to search and compare .this Error :"Exception thrown: read access violation.search was 0x1.If there is a handler for this exception, the...
6 Jun 2018 by Member 13242613
When a new program opens, my program scans that newly opened program, and if it's MD5 exists in a locally hosted database, a dialogue called Detect.vb should come up saying "Virus detected". However, that Form isn't. For some reason when I open a file that I've purposely listed in the MD5...
6 Apr 2018 by Member 13603741
I've built a mini-kernel from scratch following some tutorials , and now i want to ensure that when i boot-up my system using a boot-loader i want from this one to hash and verify if it's my real system or an infected one !? using the hash and signature mechanism!! so please if someone could...
21 Dec 2018 by Member 13616463
What is the difference between bits per object and number of hash functions evaluated for each object for storing objects in a bloom filter. We evaluate k hash function for an object which set all k bits to 1. So we are just setting k bits for an object. So how is it different number of bits...
1 Jun 2018 by Member 13737597
This article shows how Windows generates IP header's ID field
12 Oct 2018 by Member 13995616
struct person { char name[100]; int freq ; } ; I am creating an array of structure person and using this array as a hash table. int capacity; struct person table[capacity] ; I insert the string name by reading through a csv file which has a name on each of its line. When I take table...
21 May 2019 by Member 14416409
Here I want to know what encryption or hashing method may have been used. Input is either "214364506" or "333844433". Output is "jrpen2pj". I am trying to find out what encryption or decryption may been used to convert "214364506" or "333844433" in to "jrpen2pj". Can anyone please help? ...
28 Dec 2019 by Member 14549747
I'm working on a java project where I have a method that returns a hash function as a pair of integers a , b that exist in {1 , 2 , ... , 10000} and are picked randomly . To pick the random numbers I have an "rnd" variable . My problem is that I have learned that prime numbers are better for ...
28 Dec 2019 by Member 14549747
I'm working on a java project where I have to find the similarity between 2 documents using min hashing algorithm to compute the Jaccard coefficient . I'm new to the concept of hashing and for my project I have to use 100 hash functions .In my project it is said that a text of words S is...
10 Feb 2022 by Michaelred54
I get this error: "An object reference is required for the non-static field, method, or property 'HashAlgorithm.ComputeHash(byte[])'" on this code: protected void Button1_Click(object sender, EventArgs e) { ...
21 Apr 2014 by Muhammad Taqi Hassan Bukhari
I am working on my web project. I want to store user password the secure way like hashing, but i came to know that after the password is hashed it cannot be converted back. But in My project i have To implement Forgot password and reset password. Reset Password is OK but when the case of forget...
24 Apr 2014 by Muhammad Taqi Hassan Bukhari
I have created a Web Login Form For User Signup and Login. First i found that to securely store password in database, i should use hash and salt on .net pages. Then i came to know that there is a function in sql server Hash-bytes that also hashes the password, where i can store the plain...
13 Apr 2022 by NG CHEA YEAT
collision in hashing occur in this code I did, how can I resolve it in the code? I only fail to found NG CHEA YEAT's name. What I have tried: #include #include #include #define MNAME 80 #define MDIR 30 #define...
13 Sep 2012 by OriginalGriff
Your problem is that you are treating the data as text - it isn't. It is hex data, ie 128 bytes of binary data displayed on the wiki page as hex digits. You are holding it (and reading it) as 256 text characters (with or without line breaks) which will produce completely different hash values...
20 Feb 2013 by OriginalGriff
If you mean "Can we tell what was hashed to produce this?" then the answer is "no". Hashes are designed to be one-way - you cannot regenerate the original input from teh hashed value.
25 Feb 2013 by OriginalGriff
Posting the same question again, does not make the answer any different: You cannot reverse a cryptographic hash function - that is the whole idea.Can You rehash This Pass?$P$B2.fjGHWS0lSwwD40MGvyul09CqQ2A1[^]Even if it was possible, this is a professional site, not a site for hackers....
14 Mar 2014 by OriginalGriff
Loads!Lower security is nearly always faster, but you will have to do some timing tests yourself.Of you aren't interested in security, then there are loads of ways to hash stuff: MD5, CRC, even XOR and SUM.What you want too use will depend on your data, and how big your hash has to...
23 Aug 2014 by OriginalGriff
Start by checking your GenerateSalt method, and make sure it returns the same thing as the code in Do_Login does. Any slight difference here will mean wildly different values.
19 Dec 2014 by OriginalGriff
Try not converting it to a char array - send teh string directly:string password = HashPassword(tbxPassword.Text);cmd.Parameters.AddWithValue("@HashedPassword", password);Normally, I work with binary data for hashes, but since your BCryptHelper.HashPassword method is returning a string,...
13 Jan 2015 by OriginalGriff
We do not condone, support or assist in the production of malicious code in any way, form or manner. This is a professional site for professional developers. The fact that you downloaded the file from a torrent site is in breach of copyright, which is a malicious (and in most countries...
7 May 2016 by OriginalGriff
Read the filename from your textbox:string path = txtFilePath.Text;Check the file exists:if (!File.Exists(path)) { ... report problem to user. return; }Then just call your method:txtHashValue.Text = MD5HashFile(path);Simple enough, yes?
31 May 2016 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it is...