Week 5 Internet and Web Security Flashcards
what is symmetric encryption
Symmetric Encryption
.Uses single key for both encryption and decryption
.Both sender and receiver need same key
.Challenge: Securely sharing the key with intended recipient
.Common uses: Encrypting files, secure communication once key is shared
REFRESH AND READ 5_9_1 CORS ON IPAD ON GOODNOTES FROM SLIDE 11 ONWARDS
VERY IMPORTANT
asdonasfjsp;
what is the 401 status code
UNAUTHORISED
why is https more secure than http:
define what http is and talk about why its not secure
define what https and talk about why it is secure
HTTP:
Plain text transmission
Anyone can intercept and read the data
No security protection
HTTPS:
HTTP wrapped in TLS encryption
Creates secure end-to-end connection
Data protected from interception and tampering
This is exactly why modern websites, especially those handling sensitive information like logins or payments, always use HTTPS rather than HTTP.
why is http simple access authentication very risky
Credentials (username & password) sent in plain text via HTTP header.
Vulnerable to “man-in-the-middle” attacks due to lack of encryption.
Limitations:
No encryption (unlike HTTPS).
No rate limiting or account lockouts.
High risk if users reuse passwords across services.
what do we mean when we say something is cors configured
Flashcard 1: CORS-Configured Server
Definition: A server that enforces Cross-Origin Resource Sharing (CORS) rules by checking the request’s origin and including specific CORS headers in the response.
Behavior:
Accepts or rejects requests based on allowed origins.
Adds headers like Access-Control-Allow-Origin to responses.
Browser enforces CORS policies; unauthorized origins are blocked.
What is assymetric encryption
.Each person has their own public-private key pair
.Public key: Used by others to encrypt messages to you (can be freely shared)
.Private key: Only you have it, used to decrypt messages encrypted with your public key
.Sender uses recipient’s public key to encrypt → Only recipient’s private key can decrypt
.Public keys distributed via key servers, certificates, websites, or directories
Challenge: Verifying public key authenticity (solved by certificate authorities)
Example:
Alice sends to Bob → Alice uses Bob’s public key to encrypt → Only Bob’s private key can decrypt
Is:
Example:
Alice sends to Bob → Alice uses Bob’s public key to encrypt → Only Bob’s private key can decrypt
An example or symmetric or assymetric encryption
Assymetric :
. pair of public and private keys
. Alice uses bobs public key to encrypt so only he can decrypt
end to end encryption
End-to-end encryption flow:
- Clear message at sender
- Message encrypted before leaving sender’s device
- Stays encrypted during transmission
- Decrypted only on receiver’s device
- Returns to clear message
Key benefit: Message can’t be read while in transit, even by service providers ( no eavesdroppers , or man in middle)
Common examples: WhatsApp, Signal, ProtonMail
TLS aims
What are the 3 TLS aims:
Authenticity, confidentiality , integrity
Explain AUTHENTICITY aim of TLS
Authentication:
Server side must be authenticated
Client side optionally authenticated
explain CONFIDENTIALITY of TLS
Message only seen at end points ( before encryption on sender side and after decryption on receiver side)
explain INTEGRITY of TLS
Data cannot be modified by attackers without detection during transmission
whats the difference between authentication and authorisation
Authentication: Confirms the identity of the user (e.g., verifying who they are via username, password, biometrics).
Authorization: Determines what the authenticated user is allowed to do or access.
base 64
Explanation for == Padding
If the input had only 1 byte (e.g., M), the binary would be:
01001101
Divided into 6-bit chunks:
010011 01
The last chunk (01) is incomplete, so we add 4 bits of 0 to make it a chunk of 6:
010011 010000
010011 → T [ first chunk of 6]
010000 -> Q
so Far TQ
HOWEVER base 64 output must be a multiple of 4 characters
so we add two == signs
TQ==
explain Basic authentication ( probably best to read and recall)
Authorization: Basic dXNlcjpoZWxsbw==
↓
username:password (Base64 encoded)
↓
“user:hello” (when decoded)
Key Points:
Username and password combined with “:” separator
This string gets Base64 encoded
“Basic” prefix tells server it’s Basic Authentication
Base64 is just encoding (not encryption):
Anyone can decode it to see credentials
Like writing a secret in a different alphabet
Not secure on its own
Security:
Base64 is reversible → easy to decode
Must use HTTPS/TLS to encrypt the actual transmission
TLS prevents eavesdropping/man-in-the-middle attacks