[ CS: CRYPTO_&_SEC ]

Alice
πŸ‘€
Sign with Private Key
{"msg": "hAck3d", "sig": "x8f2..."}
Bob
πŸ”’
Verify with Public Key
# Purpose: Secure authentication setup
# Description: Creates a new Ed25519 key pair for SSH access
user@linux:~$ ssh-keygen -t ed25519 -C "user@pc"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
Your identification has been saved in /home/user/.ssh/id_ed25519
Your public key has been saved in /home/user/.ssh/id_ed25519.pub
# Purpose: Key sharing
# Description: Prints the public key content for distribution
user@linux:~$ cat .ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK6T7X8mJ9lPq9Wz2Q... user@pc
# Purpose: Data integrity verification
# Description: Generates a SHA-256 fingerprint for a file
user@linux:~$ sha256sum sensitive_file.txt
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 sensitive_file.txt
# Purpose: Secret protection
# Description: Restricts file permissions so only the owner can read/write
user@linux:~$ chmod 600 id_ed25519
# Ensure only owner can read the private key
# Purpose: Message confidentiality
# Description: Uses GPG to encrypt a message for a specific recipient
user@linux:~$ gpg --encrypt --recipient bob@example.com msg.txt
< BACK_TO_HOME