Java Base64 Encode and Decode a File (Text, Image, Large Files)
Base64 encode and decode a file in Java with examples for text and image files, data URIs, streaming large files with wrap(), MIME and decoding errors.
Java provides a robust security model to protect both the Java runtime environment and applications running within it. Java’s security features are designed to prevent unauthorized access, ensure data integrity, and maintain the overall safety of Java applications.
Base64 encode and decode a file in Java with examples for text and image files, data URIs, streaming large files with wrap(), MIME and decoding errors.
Learn how a JSON Web Token (JWT) works, create and validate one with jjwt 0.13 and nimbus-jose-jwt, and avoid the storage, key and expiry mistakes.
Java EdDSA example with Ed25519 and Ed448. Generate keys, sign and verify messages, save and load keys, and compare EdDSA with ECDSA, RSA and ML-DSA.
Secure random number generation in Java with SecureRandom. Create tokens and codes, pick NativePRNG, DRBG or getInstanceStrong and avoid seeding mistakes.
Java AES encryption and decryption with AES-256-GCM, random IVs, key storage, PBKDF2 and HKDF keys, file encryption, tamper detection and common mistakes.
SSLHandshakeException means the Java client and the server could not agree on a TLS connection. Fix TLS version mismatches with jdk.tls.client.protocols, untrusted certificates with keytool, and find the rest with javax.net.debug.
Bypass SSL certificate checking in Java only in local tests, and fix PKIX errors safely with a truststore, a trusted PEM certificate or Spring SSL bundles.
A current REST API security checklist with OAuth 2.1, JWT validation, TLS, authorization checks, input validation, rate limiting and OWASP API Top 10.
Set Windows environment variables without admin rights using the account dialog, setx or PowerShell, and fix JAVA_HOME and Path for Java on locked laptops.
Java file checksum examples for MD5 and SHA-256 with MessageDigest, streaming for large files, HexFormat, Guava, Commons Codec and verifying downloads.
Java Base64 encode and decode examples with java.util.Base64 for strings, URL-safe tokens, MIME email, files and streams, plus fixes for decoding errors.
Java password hashing done right with PBKDF2, bcrypt, scrypt and Argon2id, OWASP parameters, salts, real timings, and why MD5 and SHA-256 fail.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.