cryptojs

Why do I still get error code 400 from this API request to Coinbase Pro?

天涯浪子 提交于 2019-12-11 17:11:37
问题 I've followed the instructions on the Coinbase Pro developers page for authentication with API Key and no matter what I try I always get error code 400 using CryptoJS and React / React Native. https://docs.pro.coinbase.com/#api-key-permissions import CryptoJS from 'crypto-js'; import axios from 'axios'; import { Buffer } from 'buffer'; const key = '<removed'; const secret = '<removed>'; const passphrase = '<removed>'; const method = 'GET'; const uri = 'https://api.pro.coinbase.com/accounts';

Symfony2 password encoder function in Javascript

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 11:06:58
问题 I created a Symfony2 application using FOSUserBundle and FOSRestBundle. I'd like to connect other application with my Symfony application using rest api. I need to write the Symfony password encoder function in Javascript. Actually in PHP, it goes like: $salt = "secret"; $password = "azerty"; $salted = $password.'{'.$salt.'}'; $digest = hash('sha512', $salted, true); for ($i = 1; $i < 5000; $i++) { $digest = hash('sha512', $digest.$salted, true); } $digest = base64_encode($digest); return

Node.JS crypto.createHmac('sha256') command line analog

旧巷老猫 提交于 2019-12-11 08:48:04
问题 In Node.js I use following code hash = crypto.createHmac('sha256', SECRET).update(file).digest('hex'); to calculate HMAC. However Linux command line analog produces different hash code: > openssl sha256 -hmac "SECRET" file What is wrong in command line? What are correct arguments? 来源: https://stackoverflow.com/questions/50884630/node-js-crypto-createhmacsha256-command-line-analog

how to get cryptojs to work with out “rollup” files

匆匆过客 提交于 2019-12-11 06:48:34
问题 I'm trying to upgrade the old version of cryptoJS that can be found here to a newer version on github that can be found here because, there are some functions on the old version that is going to be deprecated. Unfortunately, the newer don't have rollup files, so im trying to get it to work using the core files but, I keep getting the error(s) that something is "undefined" like "cfg.hasher is undefined". <script type="text/javascript" src="crypto-js3.1.9-1/core.js"></script> <script type="text

CryptoJS encrypt Go decrypt

做~自己de王妃 提交于 2019-12-11 06:29:44
问题 I have the following Go code ciphertext := "Zff9c+F3gZu/lsARvPhpMau50KUkMAie4j8MYfb12HMWhkLqZreTk8RPbtRB7RDG3QFw7Y0FXJsCq/EBEAz//XoeSZmqZXoyq2Cx8ZV+/Rw=" decodedText, _ := base64.StdEncoding.DecodeString(ciphertext) decodedIv, _ := base64.StdEncoding.DecodeString("u9CV7oR2w+IIk8R0hppxaw==") newCipher, _ := aes.NewCipher([]byte("~NB8CcOL#J!H?|Yr")) cfbdec := cipher.NewCBCDecrypter(newCipher, decodedIv) cfbdec.CryptBlocks(decodedText, decodedText) data, _ := base64.StdEncoding.DecodeString

How to use CryptoJS with Angular 2 and TypeScript in WebPack build environment?

浪尽此生 提交于 2019-12-11 05:52:15
问题 There are a whole bunch of questions around using the CryptoJS library with Angular 2 but most assume use of SystemJS and all seem out of date with the current version of TypeScript. Can anybody give clear, simple instructions on how to use the CryptoJS library with Angular 2 and TypeScript. I've installed CryptoJS using npm install crypto-js . I've tried the recommended typings i nstall crypto.js --ambient --save but this simply gives a warning about --ambient being deprecated and to use -

Sign Key HMAC SHA1 with Javascript

和自甴很熟 提交于 2019-12-11 03:15:48
问题 For some reason I am not able to create a signature from a private key in JS. Using this online help from google: https://m4b-url-signer.appspot.com/ URL:https://google.maps.com/maps/api/geocode/json?address=New+York&client=test Example Key (fake for the purposes of the exercise) Key: QNade5DtdJKKZbidTsrIgONupc4= (Result) Signature: XDsiH5JAY7kJLgA1K2PWlhTdO1k= However, my javascript code: var keyString = 'QNade5DtdJKKZbidTsrIgONupc4='; console.log(keyString) var urlString =

Difference between CryptoJS.enc.Base64.stringify() and normal Base64 encryption

不打扰是莪最后的温柔 提交于 2019-12-11 02:59:07
问题 I'm trying to encrypt the following hash to base64: 6bb984727b8c8c8017207e54b63976dc42ea9d24ad33bd5feeaa66869b650096 It's needed to access the API of a website. The website shows an example script in JavaScript using the CryptoJS.enc.Base64.stringify() method to encrypt the hash. The result with this method is a7mEcnuMjIAXIH5Utjl23ELqnSStM71f7qpmhptlAJY= However, every online base64 encryption tool I tried gives me the following result:

How do I encrypt Crypto-JS keys with JSBN?

自闭症网瘾萝莉.ら 提交于 2019-12-11 02:22:49
问题 I'm using JSBN to encrypt/decrypt data using public/private keypairs. It works great for text data, including hex strings. My problem is now I have binary data, specifically Crypto-JS Word Arrays, that I need to encrypt with a public key and send along to another platform. So consider this: var key = CryptoJS.lib.WordArray.random(256/8); var rsa = new RSAKey(); rsa.setPublic(modulus, exponent); var encrypted_key = rsa.encrypt(key.toString()); This works but it means 'encrypted_key' is infact

Implementing HMAC-SHA256 for Keybase in Javascript

好久不见. 提交于 2019-12-11 02:00:00
问题 I am working with the keybase.io API - trying to drive it from javascript. Logging in is a two step process. The second step is detailed at https://keybase.io/docs/api/1.0/call/login. I am stuck on the following; The server and the client share this secret, and for the client to successfully log the user in, it must prove knowledge of this secret to the server. To protect against replay attacks, it does not send the secret itself. Rather, it treats pwh as MAC key, and MACs the temporary login