I hereby claim:
- I am chrisdl on github.
- I am chrisdl (https://keybase.io/chrisdl) on keybase.
- I have a public key ASDQYgsg3r5Pqx0G9Ut_xjCYzQUJr-fcFb1oGbzLDRmvSAo
To claim this, I am signing this object:
| // This kind of sucks because is relies on the window object which means the React will have issues being Isomorphic (rendered server side). | |
| // So if anyone has a better suggestion as to attaching to a global object and waiting for it to exist i'm all ears. | |
| // main.js | |
| requirejs.config({ | |
| paths: { | |
| EventEmitter: "vendor/EventEmitter" | |
| }, | |
| shim: { |
| (py27) ubuntu@ubuntu-xenial:/vagrant$ bpython | |
| bpython version 0.16 on top of Python 2.7.12 /home/ubuntu/.virtualenvs/py27/bin/python | |
| >>> from Crypto.Hash import HMAC | |
| >>> import os | |
| >>> import binascii | |
| >>> key = binascii.hexlify(os.urandom(32)) | |
| >>> msg = 'Hello World' | |
| >>> my_hmac = HMAC.new(key=key, msg=msg) | |
| >>> import Crypto | |
| >>> Crypto.version_info |
I hereby claim:
To claim this, I am signing this object:
| const crypto = require("crypto"); | |
| const hashFunction = crypto.createHash("sha256"); | |
| const plaintext = "123456"; | |
| hashFunction.update(plaintext); | |
| const hash = hashFunction.digest("hex"); | |
| console.log(hash); | |
| // Things to try: |
| const crypto = require("crypto"); | |
| class Db { | |
| constructor(users={}) { | |
| this.users = users; | |
| } | |
| // Expects passwordPayload to be a string of the form 'salt$passwordHash' | |
| // Where the '$' is used as a separator. | |
| storeUser(username, passwordPayload) { |
| // https://nodejs.org/api/crypto.html#crypto_class_cipher | |
| // 'aes256' -> AES256 - CBC | |
| // The available ciphers depend on openssl. See ``$> openssl list-cipher-algorithms`` for a list. | |
| const crypto = require("crypto"); | |
| const encrypt = (key, plaintext) => { | |
| const cipher = crypto.createCipher("aes256", key); | |
| let ciphertext = cipher.update(plaintext, "utf8", "hex"); | |
| ciphertext += cipher.final("hex"); | |
| return ciphertext; |
| const crypto = require("crypto"); | |
| class Db { | |
| constructor(users={}) { | |
| this.users = users; | |
| } | |
| // Expects passwordPayload to be a string of the form 'salt$passwordHash' | |
| // Where the '$' is used as a separator. | |
| storeUser(username, passwordPayload) { |
(3) BOTH Trifecta
| (see the picture in the first comment) |