We will be replicating the SHA-1 (secure hash algorithm) cryptographic algorithm. This algorithm was created by the NSA and is currently implemented in many applications across the world. Since the creation of the SHA-1 algorithm it has been updated to the SHA-2 standard, such as the popular SHA-256. SHA-1 takes in an input and returns a 160 bit encrypted hash value, which is usually represented by a 40 digit hexadecimal value. SHA algorithms are not meant to be decrypted and can only be decrypted through brute force methods. This is the case because the designer of the algorithm can change what constants the input is manipulated with. The encrypted hash values will change dramatically even with the slightest change in input. Because of this, SHA algorithms can detect if objects like emails are intercepted and changed, or for storing valuable information such as your SSH key on Github (which uses SHA-256 encryption). Our project stores a user input into RAM and manipulates those values frequently to edit 5 stored hash values. The end encryption result is the concatenation of those five hash values (labeled in this project as H0-H4).
Unlike most implementations of the SHA-1, our project requires that the user inserts their input so that it is compatible with our RAM. To do this, they must input their string into this Python program, and the “sha_data.mem” file will contain a large output in hexadecimal, containing mostly zeros (with the exception of the first 16 lines). All the user must do is copy this output into the file still labeled “sha_data.mem” into both the verilog and modelsim folder of the project. Please see the .mem file in the verilog folder for formatting issues.