Category Archives: Linux

Linux mixed reality

Windows Subsystem for Linux

Windows Subsystem for Linux (WSL) is new feature of Microsoft Windows 10 and 11. It look as light weight implementation of virtualization and alternative to Virtual box and/or HyperV. WSL is Windows feature with must be turned on. Go to Control Panel=>Programs and Features=>Turn Windows features on and off. Scroll down, find Windows Subsystem for… Read More »

CGO example to get openssl cipher list

This post is related to “How to get openssl cipher list programmatically” post. That post contains example written in C, current post presents example in Go which duplicates sequence of openssl API calls used by previous post. The Go example uses CGO package that enables interaction with C code of openssl shared libraries. package main… Read More »

CGO example to calculate MD5 of string

It was continuation of “Calculate MD5 programmatically (c++ and golang)” post. That post contains example of MD5 calculation written in Go. The Go example small and tidy, the new example contains significantly more line of code and looks cumbersome, however in demonstrate how to use openssl API from Go and includes multiple samples of CGO… Read More »

ssh Vulnerability DoS test

This test was created when I worked with CVE-2002-20001 vulnerability. The vulnerability is about diffie-hellman-group-exchange-sha256 key exchange algorithm with high computational complexity which is using long exponents that arguably make certain calculations unnecessarily expensive. To test the issue I created small bash script to simulate DDoS attack on ssh server using different key exchange… Read More »

OCSP request using openssl command in Linux terminal

This post is continuation of 2 previous ones. It demonstrates how to send Online Certificate Status Protocal (OCSP) request to CA server about certificate revocation status using openssl terminal commands. The procedure consists of the same steps as it was presented in c++ and c# codes: find OCSP URL, get server certificate and certificate chain,… Read More »

Linux c++ OCSP Client based on openssl API

It is functionally similar OCSP (Online Certificate Status Protocol) client as presented in previous post “Windows OCSP Client based on BouncyCastle.Crypto.dll” but oriented for Linux OS and written on C++ using openssl API. The code was tested on Ubuntu 22.04 and CentOS 8 only, but I hope it should be compatible with other Linux OS… Read More »

Calculate MD5 programmatically (c++ and golang)

MD5 is 128 bit hash digest calculated by Message Digest Method 5 algorithm. It is not so secure as SHA-256 algorithm but significantly faster. It is still widely used as thumbprint to verify data integrity and detect accidental data corruption. Here is c++ example how to calculate MD5 hash of string using openssl API. Templates… Read More »

How to get openssl cipher list programmatically

The cipher list may be retrieved using “openssl cipher” command. This command has multiple options to filter output. The same is possible to do programmatically using openssl API. Here is c++ example how to programmatically obtain a list of available ciphers with appropriate cryptographic protocols they belong to. The code was implemented and tested on… Read More »

Openssl BIO API, file saving and reading examples

The acronym BIO stands for Basic Input/Output. It is multipurpose API for various types of input and output operations, including file, memory buffer, networking. The main header file for BIO methods is bio.h, binary linking references are presented in library. Below presented 3 examples of BIO API file usage which create and read 3… Read More »

Assembler and Inline Assembler Code in g++

My career as software developer began with embedded programming for 8-bit microprocessor. The main language I used in that time was assembler. Processors changed as assembler changed as well. Later when I started develop Windows implementation in C++ I also used inline assembler instructions in my C++ code, sometime it was necessary for example when… Read More »