TECH2400 Week 04 Workshop
TECH2400 Week 04 Workshop
Cyber Security
Workshop 4
Cryptography Basics and
Network Fundamentals Review
COMMONWEALTH OF AUSTRALIA
Copyright Regulations 1969
WARNING
The material in this communication may be subject to copyright under the Act.
Any further reproduction or communication of this material by you may be the
subject of copyright protection under the Act.
1) Encryption
2) Hashing
3) Digital Signatures
How It Works:
1) A sender encrypts the data using an encryption
algorithm and a key
2) The recipient decrypts it using the corresponding
decryption key
Common Uses:
1) Securing internet communications (HTTPS, VPNs)
2) Protecting stored data (disk encryption, encrypted
messaging apps)
3) Safeguarding sensitive transactions (online banking,
digital payments)
1) Encryption
RSA (Rivest– Uses two keys: a public key for Encrypting messages,
Shamir– encryption and a private key for digital signatures, SSL/TLS
Adleman) decryption; widely used for secure certificates
communications
ECC (Elliptic Uses smaller keys compared to RSA Mobile devices, secure
Curve but provides the same level of security, communications (e.g.,
Cryptography) based on elliptic curve mathematics HTTPS)
DSA (Digital A digital signature algorithm that uses a Digital signatures in
Signature private key to sign and a public key to certificates, government
Algorithm) verify, based on mathematical theory systems
ElGamal Based on the Diffie-Hellman key Secure messaging,
exchange, using two keys for encrypting data in
encryption and decryption, and known government and banking
for its flexibility systems
Diffie-Hellman A key exchange algorithm, not directly Securing communication
used for encryption but allows two channels (e.g., VPNs, TLS)
parties to securely share a secret key
over an insecure channel
Activity: Encryption
AES Encryption & Decryption
On Windows
- Download OpenSSL: https://slproweb.com/products/Win32OpenSSL.html
- Install the software
- Select "The OpenSSL binaries (/bin) directory" to be added to the system
PATH
- Open Command Prompt and enter the following command to verify
installation: openssl version
- If it shows you a version, the installation was successful.
Activity: Encryption
Step 1: Install OpenSSL
Command breakdown:
enc -aes-256-cbc Encrypt using AES-256 in cipher block chaining
(CBC) mode.
-salt Adds randomness to prevent dictionary attacks.
-in message.txt Input file.
-out message.enc Encrypted output file.
-pass pass:Student123 Uses "Student123" as the encryption key.
Activity: Encryption
Step 5: Verify encryption
- Check your directory to see if message.enc was created
- Open the file to see if the message has been encrypted
Bonus:
What happens if you use the wrong password?
Try decrypting with a wrong key to see the effect.
2) Hashing
Hashing ensures data integrity by generating a unique
fixed-length value from input data, detecting any
modifications.
How It Works:
1) Input data is processed through a hash function.
2) A unique fixed-length hash value is generated.
3) Any change in the input results in a drastically
different hash.
Common Uses:
1) Password storage (hashed passwords in
databases).
2) Data integrity verification (checksums, file
integrity monitoring).
3) Digital signatures and certificates.
2) Hashing
How It Works:
1) A sender signs a message using their private key,
generating a digital signature.
2) The recipient verifies the signature using the
sender’s public key.
Common Uses:
1) Authenticating emails and documents.
2) Securing software updates (code signing).
3) Ensuring transaction integrity in blockchain
technology.
3) Digital Signatures
RSA Uses two keys: a public key to verify Signing emails, verifying
and a private key to sign, ensuring identity in websites
secure communication (SSL/TLS)
DSA A widely-used algorithm for creating Verifying authenticity of
and verifying digital signatures, often digital certificates and
used with government systems government documents
ECDSA A faster and more efficient version of Blockchain transactions,
DSA that uses elliptic curve secure websites (TLS/SSL)
mathematics, offering more security
with smaller keys
EdDSA A modern algorithm designed for speed Secure communications,
and security, often used for creating cryptographic protocols
very strong digital signatures
Activity: Digital Signatures
Digital Signatures & Verification
Command breakdown:
Command breakdown:
Command breakdown:
openssl dgst Tells OpenSSL to compute a hash (message digest) of
the input file.
-sha256 Specifies use of SHA-256 hashing algorithm
-sign private.pem Uses the private key for signing
-out message.sig Saves the digital signature as message.sig
message.txt Specifies the input file you are signing
Activity: Digital Signatures
Step 4: Verify the signature using the public key
- Run the following command:
openssl dgst -sha256 -verify public.pem -signature
message.sig message.txt
Command breakdown:
openssl dgst Tells OpenSSL to compute a hash (message
digest) of the input file.
-sha256 Specifies use of SHA-256 hashing algorithm
-verify public.pem Specifies use of public.pem to verify signature
-signature message.sig Specifies the signature file to verify
message.txt Specifies the original input file to verify
PKI is a framework that manages public and private key pairs and
distributes digital certificates.
TLS (successor of SSL) is one of the most widely used protocols for
securing communications over the internet (e.g., HTTPS).
TLS Handshake:
• The server presents its digital certificate (signed by a trusted CA)
to the client.
• The client verifies the certificate to ensure the server is who it
claims to be.
• Secure communication begins once both parties have exchanged
keys and agreed on encryption methods.
PKI & TLS
• PKI creates a trustworthy environment by verifying public keys
using trusted CAs.
Two Types:
• IPv4: 32-bit address
o e.g., 192.168.1.1
• IPv6: 128-bit address
o e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Role in Networking:
• Devices on a local network use private IP addresses to
communicate within the same network.
• To access external networks (e.g., the internet), they send
data to a default gateway (usually a router).
• The gateway forwards traffic to destinations outside the
local network, determining the next steps to deliver the
data.
Subnets
A subdivision of an IP network that allows efficient
management of IP addresses.
Potential attack:
- IP Spoofing: Malicious actors impersonating a trusted IP
address.
Routing
The process of forwarding data packets between networks
based on IP address.
Potential attack:
- BGP Hijacking: Attackers manipulate routing tables to
redirect traffic.
Packet Structures
Packet Header: Contains metadata such as source and
destination IP addresses, protocol type, and other control
information.
Types of Packets:
- ICMP: Used for network diagnostics (e.g., ping).
- TCP: Connection-based, reliable communication.
- UDP: Connectionless, faster but unreliable.
Packet Structures
Vulnerability:
Unencrypted packets or insecure protocols can expose
sensitive information.
Potential attacks:
- Packet Sniffing: Intercepting and reading network traffic.
- Packet Injection: Injecting malicious packets into a
network to disrupt communication or exploit
vulnerabilities.
Firewall Overview
A network security system that monitors and controls
incoming and outgoing network traffic based on
predetermined security rules.
Types of Firewalls:
- Network Firewalls: Control traffic between networks
(e.g., between internal network and internet).
- Host-based Firewalls: Installed on individual devices to
control traffic for that device.