Security
Security
Authentication
Authentication Factors
= What you know (knowledge)
= password, pin
= What you have (ownership)
= Access cards, FOB, keys
= What you are (inherence)
= DNA, Face
= Single-factor authentication – most common and weak authentication category, where you are
asked one of those 3 above
= Multi-factor authentication – two distinct factors must pass before you are granted access
HTTP Authentication
= HTTP Basic Authentication
= HTTP Digest Authentication
= Form-Based Authentication
Authorization – what rights and privilege a user has once they are authenticated
Cryptography – Symmetric Encryption – using the same key when encrypting and decrypting
= Alice encrypts a message with a key
= Alice sends the cipher
= Eve cannot understand the cipher because she doesnt have the same key
= Bob has the same key and used it to decrypt the cipher so he can understand it
Cryptography – Vigenere
Encryption:
• Align the keyword above the plaintext:
• Plaintext: H E L L O Keyword: K E Y K E
• Convert letters to numbers (A=0, B=1, ..., Z=25):
Plaintext: 7 4 11 11 14 Keyword: 10 4 24 10 4
• Add the corresponding numbers modulo 26:
Encrypted Numbers: (7 + 10) % 26 = 17 (R) (4 + 4) % 26 = 8 (I) (11 + 24) % 26 = 9 (J)
(11 + 10) % 26 = 21 (V) (14 + 4) % 26 = 18 (S)
• Convert the encrypted numbers back to letters:
Ciphertext: RIJVS
Now, let's decrypt the ciphertext back to the original plaintext using the same keyword.
3. Decryption:
• Align the keyword above the ciphertext:
Ciphertext: R I J V S Keyword: K E Y K E
• Convert letters to numbers:
Ciphertext: 17 8 9 21 18 Keyword: 10 4 24 10 4
• Subtract the keyword numbers from the ciphertext numbers modulo 26:
Decrypted Numbers: (17 - 10) % 26 = 7 (H) (8 - 4) % 26 = 4 (E) (9 - 24) % 26 = 11 (L)
(21 - 10) % 26 = 11 (L) (18 - 4) % 26 = 14 (O)
• Convert the decrypted numbers back to letters:
Decrypted Plaintext: HELLO
Blockchain Database
= a network of computers sharing the same ledger of all transactions that have taken place on
the network:
Encryption
• Internet Communication:
• Private/Secret Keys (sk) and Public Keys (pk)
• If you want someone to send you a message:
Sender: Encrypt(Message,pk) -> Encrypted Message
Receiver (you): Decrypt(Encrypted Message,sk) -> Message
• If you want to send a message to someone:
Sender (you): Encrypt(Message, sk) -> digital signature
Receiver: Decrypt(Message, digital signature, pk) -> T/F
Hashing
A hash function is any function that maps an input of arbitrary size into data of a fixed size
Cryptocurrency
= a ledger of all currency transaction that have taken place on the network
LEGER:
A has given D $10
C has given G $30
Cryptocurrency: mining
• If the transaction is valid, all miners on the network will start work on
finding an answer to a very time-consuming problem to harden the
transaction “block”.
• Once an answer is found, the new block is added to the block chain
including a “proof of work”, and the miner is rewarded for their efforts