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

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

HTTPS and SSL Certificates

HTTP(s) The http protocol sends data as plaintext, which is an issue when sharing sensitive data such as messages and passwords. https uses TLS to encrypt sensitive traffic between the client and server, creating a secure connection between the two. TLS TLS is a form of encryption, used to secure HTTPS connections. TLS replaces SSL (a deprecated protocol), however, the term SSL is still used often. Handshake To establish a secure connection, a ‘handshake’ is performed between the client and the server. ...

3 min · 435 words · TrudeEH

IRC

The IRC Protocol IRC is a very simple communication protocol that allows users to chat in real time. IRC is very lightweight, but does not encrypt messages by default. Using IRC Server To be able to communicate, users must connect to a server. Each server has its own rules, bots and commands. The IRC protocol itself does not implement encryption, however, SSL Certificates can be used to establish a secure connection with the server. Every message sent can be read by the server, including private messages between users. Separate IRC instances can communicate. This concept is often called server federation. This allows for users in different servers to send messages to each other. ...

5 min · 974 words · TrudeEH

SSH

SSH is a protocol for accessing a terminal remotely. For SSH to work, the remote machine needs to have an OpenSSH instance running and listening for connections, and port 22 must be allowed through any VPNs or firewalls between the client and host machines. An SSH client is also needed, be it any UNIX system (using the ssh command), or a Windows server using a client such as PuTTY. OpenSSH Client Connect to a Remote Server Connect Using a Password ssh <user>@<ip> > <password> ssh root@192.168.1.133 > Ctrl+D # Disconnect After connecting to a server for the first time, the fingerprint of that server is stored in the ~/.ssh/known-hosts file. ...

3 min · 490 words · TrudeEH