Encryption [GPG]

Symmetric Encryption User A sends a password to user B. The password is used to encrypt the messages. A secure way to share the password is required. Asymmetric Encryption Users A and B have a public key and a private key. The public keys are shared, and they are used to encrypt the messages. The users can use their private keys to decrypt the messages. GPG Create a Set of Keys gpg --full-gen-key Select ECC (sign and encrypt) - The most secure option Select default curve Encrypt a File gpg --encrypt -r email@example.org <file> # Encrypt with the recipient (-r) key. Decrypt a File gpg --decrypt --output <file-output> <file> # Use the private key to decrypt a file. Encrypt a Message echo "Very safe message" | --encrypt --armor -r email@example.org -armor Saves the encrypted info in plain text. (Great for blog posts or copying/pasting) Decrypt a Message GPG automatically figures out which private key to use. The encrypted file includes some metadata. ...

2 min · 297 words · TrudeEH

Firewall [UFW]

A firewall monitors and controls all incoming and outgoing network traffic, and can be implemented in the hardware or software level. See All Open Ports All ports opened by a program, including those blocked by a firewall. sudo ss -tupln Software Firewall (UFW) # Enable the SSH port if it is being used sudo ufw limit 22/tcp # `limit` is used to prevent bruteforce # Set default connection settings sudo ufw default deny incoming sudo ufw default allow outgoing # Open ports for the services running sudo ufw allow 80/tcp # Web server 1 sudo ufw allow 443/tcp # Web server 2 # Check if UFW is running and is configurations sudo ufw status numbered # Delete an entry sudo ufw delete 2 # Number given by `status numbered` # Enable UFW sudo ufw enable Block Pings Blocking pings prevents hackers from quickly discovering the server. It is still possible to scan all ports on the server and eventually find any open one, but it adds another layer of security. ...

2 min · 282 words · TrudeEH

HTTP [CURL]

HTTP HTTP (Hypertext Transfer Protocol) is a communication protocol used to send messages between the client and server, mainly used for the web. It’s stateless, meaning each request is independent, which is why web browsers often use cookies to save state. Request Structure Request Line: Method, URI, HTTP version (e.g., GET /index.html HTTP/1.1). Headers: Metadata about the request. Body (Optional): Data for POST, PUT, PATCH requests. Response Structure Status Line: HTTP version, status code, reason phrase (e.g., HTTP/1.1 200 OK). Headers: Metadata about the response. Body (Optional): Response data (HTML, JSON, etc.). Methods GET: Retrieve a resource. Should only retrieve data and not have side effects. POST: Submit data to be processed. PUT: Replace a resource. DELETE: Delete a resource. PATCH: Partially modify a resource. HEAD: Retrieve headers only. OPTIONS: Describe communication options. HTTP Headers HTTP headers are key-value pairs providing additional information about requests and responses. ...

3 min · 635 words · TrudeEH

Password Manager [PASS]

Password Managers A password manager is a program responsible for saving all your passwords. You could have a single password and use it for everything, but if an attacker gets a hold of your password on just one service, they would have access to all of your accounts. Different services may have different requirements for passwords, too. To mitigate these issues, it’s recommended to use a password manager, and a unique password for each service. There are many options available, however, pass is one of the simplest ones. ...

3 min · 524 words · TrudeEH

Terminal Multiplexer [TMUX]

Overview tmux is a multiplexer that, among other things, is able to: Preserve a terminal session if it is closed or lost. Access an old session from a new terminal window. Connect to a remote session and save its state once disconnected. Split the terminal into multiple tabs and panes. Components Sessions (Only one tmux session can be used at a time. Similar to workspaces.) Windows (A session contains windows. These behave like tabs in other programs.) Panes (A split in the window, each with its own terminal instance.) ...

3 min · 610 words · TrudeEH