View on GitHub

reading-notes

CodeFellows Class Reading Notes

User Modeling

Cryptography

Cryptography: The science which studies methods for encoding messages so that they can be read only by a person with the information necessary (known as the key) to decrypt them

Cryptanalysis: The science of decoding encrypted messages without the proper key

Hash Algorithms

Cypher Algorithms

Basic Authorization

Browser Example:

let encoded = window.btoa('someusername:P@55w0rD!')
// c29tZXVzZXJuYW1lOlBANTV3MHJEIQ==

let decoded = window.atob('c29tZXVzZXJuYW1lOlBANTV3MHJEIQ==');
// someusername:P@55w0rD!

request({
  method: 'GET',
  url: 'https://api.example.com/login',
  headers: {
    Authorization: `Basic ${encoded}`,
  },
})
.then(handleLogin)
.catch(handleLoginError)

Node Example:

let base64 = require('base-64');

let string = 'someusername:P@55w0rD!';
let encoded = base64.encode(string); // c29tZXVzZXJuYW1lOlBANTV3MHJEIQ==
let decoded = base64.decode(encoded); // someusername:P@55w0rD!

Home