Category Archives: Linux

Linux mixed reality

Simulate SIGPIPE signal

SIGPIPE signal happens on attempt to write to closed or broken pipe. In this situation process is terminated and returns error code 141. It is possible to simulate this signal by creating not correct output redirection. Example below shows that tee command output to stdout and file a.a and returns 0: # echo -n ladydebug.com… Read More »

snmp++v3 crashes after version upgrade.

SNMP++v3.x is free open source c++ API library which may be used in different operating systems such as Linux, FreeBSD, Mac OS X, Solaris and Windows. Initially it was developed by Hewlett-Packard, but currently maintained by AGENTPP. I started to use it beginning from version snmp++-3.2.17 and time by time upgrading to newer one. Usually… 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 ddosssh.sh 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 »