I am migrating function using Google's CryptoJS to browser native WebCryptography API.
With CryptoJS, I use the following code to get the words array of SHA1 hash
and it returns
[888149035, -1762573935, 1178769020, -1914057363, 481296384]
With WebCrypto API, I use
const msgBuffer = new TextEncoder().encode('1w0g6Ixf2VHvOc+6pGBqDHItFYQ=:9590467')const hashBuffer = await crypto.subtle.digest('SHA-1', msgBuffer);const hashArray = Array.from(new Uint8Array(hashBuffer));
[52, 240, 20, 43, 150, 241, 65, 145, 70, 66, 150, 124, 141, 233, 205, 109, 28, 176, 0, 0]
How can I transform this result to the same array as CyptoJS?
I checked some certificate its
SHA1 in my browser (Firefox).Now I checked if this SHA1 was also in my keystore using:
keytool -list -keystore $PATH
I didn't find the same
SHA1 in the keystore but the connection is working.Is it possible the
SHA1 is different in the keystore (after adding it) then in the browser?
I am looking into this API https://www.wawision.de/helpdesk/api and trying to connect from to a hybrid app. I need to generate Hash and then Send a request to connect to the Server. but I am totally Lost where to start in Phonegap . can anyone give me a small hint or tipp. or maybe an example of how to connect throught PPhonegap (JS) top the server.thanks
Suppose you wanted to make a file hosting site for people to upload their files and send a link to their friends to retrieve it later and you want to insure files are duplicated where we store them, is PHP's sha1_file good enough for the task? Is there any reason to not use md5_file instead?
For the frontend, it'll be obscured using the original file name store in a database but some additional concerns would be if this would reveal anything about the original poster. Does a file inherit any meta information with it like last modified or who posted it or is this stuff based in the file system?
Also, is using a salt frivolous since security in regards of rainbow table attack mean nothing to this and the hash could later be used as a checksum?
One last thing, scalability? initially, it's only going to be used for small files a couple of megs big but eventually...
Edit 1: The point of the hash is primarily to avoid file duplication, not to create obscurity.