Category : cryptography

function getSatangProBalance(coin) { var url = "https://satangcorp.com/api/users/me"; var STP_APIKEY = "TDAX-API xxx"; //REPLACE WITH YOUR API KEY! var STP_SECRET = "xxxxxxxxx"; var signature = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_512,url,STP_SECRET); signature = signature.map(function(byte) { return (‘0’ + (byte & 0xFF).toString(16)).slice(-2); }).join(”); var headers = { authorization : STP_APIKEY, signature : signature }; var options = { "headers": headers, }; var ..

Read more

i am trying to rebuild Amazon S3 authorization header in javascript. Currently what i have is this const encoder = new TextEncoder(‘utf-8’); stringToSign = encoder.encode(stringToSign); let decode = Buffer.from(secretKey, ‘base64’); decode = encoder.encode(decode); var hmac = crypto.createHmac(‘sha1’, decode).update(new Buffer(base64Policy, ‘utf-8’)).digest(‘base64’); stringToSign is POST  594bc6507c5ea009b944afcbed445d8c  application/x-www-form-urlencoded; charset=utf-8  Sun, 25 Apr 2021 20:48:06 GMT  secretKey is N2Y3Y2MwYjY4MjM4NGJlNzg2Y2I2NmUxMWE4NjRjMzY= ..

Read more

I am using an embedded chip called an ATECC508A in order to generate a ECDSA SHA-256 public/private key, and signature for a given message. When I read the public key from the chip, I obtain a value of: 0x4B 0x34 0x89 0xAB 0x1B 0xE2 0x4C 0x84 0xA4 0x74 0xBE 0x85 0xD9 0xCF 0x99 0xF1 0x12 ..

Read more

I have the following: let original = ‘something’ let passphrase = uuidv4() let encrypted = CryptoJS.AES.encrypt(original, passphrase) // I want this part to take ≈ 10 minutes *minimum* let decrypted = CryptoJS.AES.decrypt(encrypted, passphrase) I understand that the decryption time will depend on: The size of the original file The type of encryption used The processing ..

Read more

I have some piece of data: let original = ‘something’ Which I encrypt using some passphrase and some encryption method: let encrypted = encrypt(original, passphrase) I then provide the end-user, a browser with: the decrypt() method the encrypted file the passphrase The "end-user" then calls the method: let decrypted = decrypt(encrypted, passphrase) and the file ..

Read more

It’s a game. I want to hide a specific string of characters ( e.g. some binary file) inside a pool of random characters and then ask the "end-user", the "player", to find that string/file. Prerequisites: I obviously need to provide the "player" with a tool to perform the search. The "search" needs to take place ..

Read more

If I use this code: let enc = new TextEncoder(); let data = enc.encode(‘January February’); let algorithm = { name: ‘AES-CBC’, iv: enc.encode(‘0123456789ABCDEF’) }; crypto.subtle.importKey( ‘raw’, enc.encode(‘GHIJKLMNOPQRSTUV’), ‘AES-CBC’, true, [‘encrypt’] ).then( key => crypto.subtle.encrypt(algorithm, key, data) ).then( ct => console.log(btoa(String.fromCharCode(…new Uint8Array(ct)))) ); I get this result: q6BAetimbeLcdlSC7GoBbtrh/HM4xs3t1+BzEYxdEIk= If I use this PHP code, I get ..

Read more