sha256

Reading zip file content for later compute sha256 checksum fails

Reading zip file content for later compute sha256 checksum fails Question: I have a zip file which contains some regular files. This file is uploaded to a fileserver. Now I am trying to compute the sha256 checksum for the zip file, then write the checksum into a *.sha256sum file and upload to the fileserver as …

Total answers: 1

My Merkle Tree calculation does not match the actual one

My Merkle Tree calculation does not match the actual one Question: I am studying bitcoin. https://en.bitcoin.it/wiki/Protocol_documentation#Merkle_Trees I read the above URL and implemented Merkle root in Python. Using the API below, I collected all transactions in block 641150 and calculated the Merkle Root. https://www.blockchain.com/explorer/api/blockchain_api The following is the expected value 67a637b1c49d95165b3dd3177033adbbbc880f6da3620498d451ee0976d7b1f4 (https://www.blockchain.com/btc/block/641150 ) The values …

Total answers: 1

Verifying username and password input through flask python

Verifying username and password input through flask python Question: My project requires I read and write input username and password to a text file (not db or json). From there when the user logs in, I need to verify that the username and password match. I have encrypted the password using sha256. Every time I …

Total answers: 1

am getting identical sha256 for each json file in python

am getting identical sha256 for each json file in python Question: I am in a huge hashing crisis. Using the chip-0007’s default format I generatedfew JSON files. Using these files I have been trying to generate sha256 hash value. And I expect a unique hash value for each file. However, python code isn’t doing so. …

Total answers: 1

SHA256 Personal Implementation Is Only Returning The Correct Hash Value For Input Messages With A Block Size That Doesn't Exceed 512 Bits

SHA256 Personal Implementation Is Only Returning The Correct Hash Value For Input Messages With A Block Size That Doesn't Exceed 512 Bits Question: SOLVED For a while I’ve been working on my own implementation of the SHA256 in Python to entertain my interest in mathematics and programming. The problem I’m currently struggling with is that …

Total answers: 1

How to create Base64 encode SHA256 string in Javascript?

How to create Base64 encode SHA256 string in Javascript? Question: I want to log script hashes to implement content security policy. I have been able to generate the hash in python with the following code: import hashlib import base64 string=”’ //<![CDATA[ var theForm = document.forms[‘ctl00’]; if (!theForm) { theForm = document.ctl00; } function __doPostBack(eventTarget, eventArgument) …

Total answers: 3

How to verify integrity of files using digest in python (SHA256SUMS)

How to verify integrity of files using digest in python (SHA256SUMS) Question: I have a set of files and a SHA256SUMS digest file that contains a sha256() hash for each of the files. What’s the best way to verify the integrity of my files with python? For example, here’s how I would download the Debian …

Total answers: 3

Invalid start byte when using decode()

Invalid start byte when using decode() Question: As a project, I have been experimenting with encoding, decoding, and hashing; I have been getting this common error every time, I test this program. The error is UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf2 in position 0: invalid continuation byte on line var_hash = str(newhash.digest(), encoding = …

Total answers: 2

Sign a byte string with SHA256 in Python

Sign a byte string with SHA256 in Python Question: Currently I have some code that signs a byte string with the SHA256 algorithm using the native OpenSSL binary, the code calls an external process, sends the parameters, and receive the result back into the Python code. The current code is as follows: signed_digest_proc = subprocess.Popen( …

Total answers: 1

Python: TypeError: Unicode-objects must be encoded before hashing

Python: TypeError: Unicode-objects must be encoded before hashing Question: I am trying to read in a file of passwords. Then I am trying to compute the hash for each password and compare it to a hash I already have to determine if I have discovered the password. However the error message I keep getting is …

Total answers: 2