ssh audit

Overview ssh-audit is a tool for ssh server & client configuration auditing(banner, key exchange, encryption, mac, compression, compatibility, security, etc). Installation On Arch pacman -S ssh-audit pip pip3 install ssh-audit Generic - Download and extract tarball from release Usage ./ssh-audit.py 192.168.101.201 References https://github.com/jtesta/ssh-audit https://www.ssh-audit.com/hardening_guides.html

May 20, 2025 · 1 min

SHA-256 (Secure Hash Algorithm 256-bit)

SHA-256 is a cryptographic hash function that produces a fixed-size 256-bit (32-byte) hash. It is deterministic, collision-resistant, and designed for security-critical applications. How SHA-256 Works Preprocessing: Pad the input to a multiple of 512 bits. Append a 1, then add k zeros, and finally append the original message length (64 bits). Initialize Hash Values: Use constants derived from the fractional parts of square roots of the first 8 primes (eight 32-bit words). Example: h0 = 0x6a09e667, h1 = 0xbb67ae85, .... Process Blocks: Split the padded message into 512-bit blocks. For each block: Expand the block into 64 words using a message schedule. Perform 64 rounds of compression using bitwise operations (e.g., XOR, AND, modular addition). Compression Function A compression function is applied to each block, creating a new hash value. This function involves mixing the bits of the current hash value and the message block. Iteration Repeat the compression function for each block, using the output of each iteration as input for the next. Final Hash: Combine the intermediate hash values to produce the final 256-bit digest. Example: SHA-256 for String “Hello” Input: “Hello” → ASCII 48656C6C6F. Padding: Length = 40 bits (5 bytes). Pad with 1, 407 zeros, and 0000000000000028 (hex for 40 bits). Hash Computation: After processing, the final hash is: 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969. Use Cases SHA-256 Cryptographic security in: Digital signatures (SSL/TLS certificates). Password storage (hashed+salted). Blockchain (Bitcoin transactions). File integrity verification (e.g., software downloads). Guarantees: Pre-image resistance, collision resistance.

January 29, 2025 · 2 min

CRC (Cyclic Redundancy Check)

CRC is an error-detection code used to detect accidental changes to raw data (e.g., during transmission or storage). It works by treating the data as a polynomial and performing polynomial division with a predefined generator polynomial. The remainder of this division becomes the CRC value. How CRC is Calculated Convert data to binary: Treat the data as a sequence of bits. Append zeros: Add n zeros to the end of the data, where n is the degree of the generator polynomial (e.g., CRC-32 uses a 33-bit polynomial, so append 32 zeros). Polynomial division: Divide the data + zeros by the generator polynomial using modulo-2 arithmetic (XOR operations). CRC value: The remainder of this division is the CRC checksum. Example: CRC-8 for String “Hi” Data: “Hi” in ASCII is 01001000 01101001. Generator Polynomial: CRC-8 (e.g., x⁸ + x² + x + 1), represented as 100000111. Append 8 zeros: Data becomes 010010000110100100000000. Perform division: Divide 010010000110100100000000 by 100000111 using XOR. Remainder: Let’s assume the remainder is 00110110 (hex 0x36). Final CRC: 0x36. Use Cases Error detection in: Network protocols (Ethernet, Wi-Fi). Storage systems (hard drives, ZIP files). Quick checksums for small data transfers. Not secure against intentional tampering.

January 29, 2025 · 1 min

SSL Certificate

An SSL certificate is a digital certificate issued by a trusted third-party authority known as a Certificate Authority (CA). It verifies the identity of a website or server and enables secure, encrypted communication. Components of an SSL Certificate Public Key: Used for encryption and verifying the certificate’s authenticity. Certificate Holder Information: Details like the domain name, organization, and location. Issuer Information: The CA that issued the certificate. Validity Period: Specifies the time frame during which the certificate is valid. Digital Signature: Ensures the certificate was issued by a trusted CA and has not been tampered with. Self-Signed Certificates Examples and Differences Type Usage Example Difference Self-Signed Internal servers, testing Generated via OpenSSL Not trusted by default in browsers or OS. CA-Signed Public-facing servers Issued by DigiCert, Let’s Encrypt Trusted by browsers and OS. Wildcard Certificate Secures a domain and its subdomains *.example.com Can’t be self-signed, requires a CA. Multi-Domain Certificate Covers multiple domains example.com, test.com Self-signed possible but not widely used. Self-Signed Certificates A self-signed certificate is a digital certificate that is not issued by a trusted Certificate Authority (CA) but is signed by the entity it is certifying (e.g., your own server). These certificates are primarily used for internal testing, development environments, or scenarios where external trust is not required. ...

December 10, 2024 · 3 min

SSL(Secure Socket Layer)

Its purpose is to ensure that all data transmitted between the server and the client remains private and secure from eavesdropping, tampering, or forgery. While SSL itself has been deprecated in favor of its successor, TLS (Transport Layer Security), the term “SSL” is still commonly used to refer to the broader concept of secure network communication.

December 10, 2024 · 1 min

RSA

RSA (Rivest–Shamir–Adleman) is an asymmetric cryptographic algorithm, widely used for secure data transmission, especially for signing and encrypting data. In the RSA signing process, a private key is used to sign the message, while a public key is used to verify the signature. Here’s how the signing and verification process works: 1. Public and Private Keys Private Key: This key is kept secret and is used to sign data. Only the entity that owns the private key should be able to generate the signature. Public Key: This key is shared with others. It is used to verify that the data was indeed signed by the corresponding private key holder. Key Pair: RSA works on a pair of keys(one private and one public). A unique public/private key pair is generated together. There cannot be multiple private keys for a given public key. For embedded systems, where resources (CPU, memory) are limited, RSA’s asymmetric nature means that only the private key holder can sign, while anyone with the public key can verify. This is useful in secure boot processes or authenticating firmware updates, as the system can verify code signed by the vendor. ...

October 18, 2024 · 4 min