Title: SHA Algorithm doubt Post by: so98nn on May 22, 2020, 04:09:40 PM This is quoted from one of the site which explains SHA algorithm steps.
Quote The next step is to run a set of functions over the words in a specific order operating off the five variables that were set in step 1. The functions combine AND, OR & NOT operators combined with left shifts. Hi, I am stuck at one of the step where it says the quoted process. Step 1 is nothing but creation of five variables, lets say H0 to H4, For example, Code: H0 - 01100111010001010010001100000001 Now the above quoted step states that you have to use functions such as AND, OR & NOT to specify the new order in the above code. I don't understand what they are trying to do here. How to use those function here and what order to be achieved ? Title: Re: SHA Algorithm doubt Post by: Peanutswar on May 22, 2020, 04:40:04 PM Sha is commonly use for an algorithm like in hashing. The AND, OR, and NOT those are the logic gates uses these commonly use for computer language
in AND if there is a 0 the value becomes 0. In boolean expression if there is a false it is already false Example 001 111 Answer 001 Example H0 - 01100111010001010010001100000001 H1 - 11101111110011011010101110001001 Answer 01100111010001010010001100000001 In OR if there is a true statement it is already true. If there is 1 it becomes 1 Example 011 111 Answer 111 Example H2 - 10011000101110101101110011111110 H3 - 00010000001100100101010001110110 Answer 10011000101110101101110011111110 In NOT you are going to reverse the particular value. If this is true the value becomes false. Example 0 Answer 1 Example H4 - 11000011110100101110000111110000 Answer 00111100001011010001111000001111 I hope this will help you to enlighten. Before I create a simple hashing using SHA-256 Code: Random r = new Random(); I hope this will help you how to make a sha. |