How to check OpenSSH version

On Linux, macOS, or Windows, we can use ssh -V (uppercase V) to check the OpenSSH version currently installed. Example 1 Terminal $ ssh -V OpenSSH_9.0p1, LibreSSL 3.3.6 Example 2 Terminal $ ssh -V OpenSSH_8.4p1 Debian-5+deb11u1, OpenSSL 1.1.1n 15 Mar 2022 References Wikipedia – OpenSSH OpenSSH Release Notes

Where is the java.security file?

In Java, we can find the java.security file at the following location: $JAVA_HOME/jre/lib/security/java.security $JAVA_HOME/conf/security For Java 8, and early version, we can find the java.security file at $JAVA_HOME/jre/lib/security/java.security. Terminal $ /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security$ ls -lsah total 12K 4.0K drwxr-xr-x 3 root root 4.0K Mei 12 11:53 . 4.0K drwxr-xr-x 8 root root 4.0K Mei 12 11:53 .. …

Read more

Nginx + ModSecurity and OWASP CRS

This tutorial shows how to install ModSecurity (open source web application Firewall) in Nginx, and also enable the OWASP ModSecurity Core Rule Set (CRS). Tested: Nginx Open Source 1.17.7 ModSecurity 3.0 OWASP ModSecurity CRS 3.2.2 Debian The official guide of installing ModSecurity for NGINX is very detail and well documented, and you should refer it. …

Read more

Java – How to convert byte arrays to Hex

This article shows you a few ways to convert byte arrays or byte[] to a hexadecimal (base 16 or hex) string representative. String.format Integer.toHexString Apache Commons Codec – commons-codec Spring Security Crypto – spring-security-crypto Bitwise shifting and masking. (educational purposes) Note Both Apache Commons-Codec and Spring Security Crypto modules are using the similar 5. Bitwise …

Read more

Java – Symmetric-Key Cryptography example

Symmetric-Key Cryptography is an encryption system in which the same key is used for the encoding and decoding of the data. The safe distribution of the key is one of the drawbacks of this method, but what it lacks in security it gains in time complexity. One should always assume that the encryption algorithms are …

Read more

Java – How to create strong random numbers

SecureRandom class in Java provides a cryptographically secure pseudo – random number generator and its intended use is for security sensitive applications. In this example, we will not use it for its intended purpose, but rather present its methods in a simple password generator. 1.Password Generator Using Secure Random A convention, we made for our …

Read more

ModSecurity exclude rules for editing posts and pages in WordPress

When editing post or page in WordPress, sometime the server’s firewall will block my IP address, and the log showed the following error: Terminal lfd: (mod_security) mod_security triggered by xx.xx.xx.xx : 5 in the last 300 secs The quick fix is to restart the modem or uses a VPN to get a new IP to …

Read more

Struts 2 on GAE – java.security.AccessControlException: access denied

Problem Developing Struts2 (v 2.3.1.2) on Google App Engine (SDK v1.6.3.1), local development, hit “java.security.AccessControlException: access denied” error? Solution Normally, this is because you turn the “devMode on” in struts.xml file. File : struts.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> //… </struts> …

Read more

Application Authentication with JAX-WS

One of the common way to handle authentication in JAX-WS is client provides “username” and “password”, attached it in SOAP request header and send to server, server parse the SOAP document and retrieve the provided “username” and “password” from request header and do validation from database, or whatever method prefer. In this article, we show …

Read more

JCE Encryption – Data Encryption Standard (DES) Tutorial

In this article, we show you how to use Java Cryptography Extension (JCE) to encrypt or decrypt a text via Data Encryption Standard (DES) mechanism. 1. DES Key Create a DES Key. KeyGenerator keygenerator = KeyGenerator.getInstance("DES"); SecretKey myDesKey = keygenerator.generateKey(); 2. Cipher Info Create a Cipher instance from Cipher class, specify the following information and …

Read more