As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [openssl]

OpenSSL is an open source software toolkit that implements the SSL/TLS protocol, as well as a general cryptographic library.

Filter by
Sorted by
Tagged with
2 votes
1 answer
69 views

bash script to setup a digitalocean webserver (apache2, nginx, PHP7.4, fastcgi, SSL)

The following bash script is intended to be run on a freshly installed digitaloceans ubuntu 20.04 droplet by root in its home dir. The purpose is to setup a ready to use webserver with SSL (certbot), ...
Roadrunner85's user avatar
1 vote
1 answer
1k views

.Net BouncyCastle - PKCS#3, PKCS#8 & PKCS#10 Generation as base64

Reaserching BouncyCastle for C# is not for the faint of heart. After navigating an ocean of Java dead ends, I have arrived at the following code. I believe it's very useful for someone who wants to ...
suchislife's user avatar
4 votes
5 answers
4k views

C++ AES Encryption Class

I am working with OpenSSL and writing an AES256 encryption module. My knowledge of cybersecurity is not vast and I would like to know whether there are any obvious holes I'm leaving. The intent is for ...
kich's user avatar
  • 41
4 votes
1 answer
189 views

Cryptographic hashing class using OpenSSL's EVP interface

I have written a cryptographic hashing class named Ccksum::DigestHasher that allows the caller to select a hashing algorithm by name via OpenSSL's EVP interface. ...
user avatar
1 vote
0 answers
215 views

Use OpenSSL and Qt to build the correct X509 certificate chain based on a pool and a leaf

This is my solution to a question I asked on stackoverflow. The scenario is as follows: I got my X509 certificate and a pool of other X509 certificates. Now I want to calculate the chain of trust, ...
Eric's user avatar
  • 235
4 votes
2 answers
950 views

Securing my password wallet

I am currently learning C++, so I made this basic password wallet for Ubuntu. Its source code is in the /opt directory and it has a symlink so i can launch it from ...
Anass Youness's user avatar
5 votes
1 answer
2k views

Secure socket programming with OpenSSL and C

Background Lately, I found OpenSSL to be difficult to learn as a beginner, while it can be implemented inside beginner-friendly projects like socket programming. ...
Ori David's user avatar
  • 175
4 votes
2 answers
130 views

Automatic CRL files converter

In my job we use our internal CA, which runs on a Windows server. When I want to use its CRL on a Linux machine I have to do these steps: download root CA and intermediate CAs covert them to x509 ...
David Mosler's user avatar
3 votes
0 answers
627 views

Verify OpenSSL RSA signature (PHP) with .NET (VB)

I would like to achieve something I believe is pretty standard: A) My VB.NET client (ideally targetting Framework 4.0) sends a text string to my Apache/PHP Server via an HTTPS POST request. B) My ...
Ama's user avatar
  • 265
0 votes
1 answer
47 views

Shell POSIX OpenSSL file decryption script follow-up #3 (final)

From original very simplistic code: Shell POSIX OpenSSL file decryption script I learned a lot both from the first follow-up review, and the second one as well, many thanks! I just need one final ...
Vlastimil Burián's user avatar
7 votes
1 answer
28k views

A Simple C++ Client That Sends Data Over TLS Using OpenSSL

I am learning C++ and socket programming and OpenSSL. As such, I decided to make a simple client that opens a TLS connection and writes some data as practice. It also serves as a base for more complex ...
Foobar's user avatar
  • 173
0 votes
1 answer
62 views

Shell POSIX OpenSSL file decryption script follow-up #2

This question is the second follow-up of: Shell POSIX OpenSSL file decryption script The first follow-up was: Shell POSIX OpenSSL file decryption script follow-up #1 Both of which have proven very ...
Vlastimil Burián's user avatar
0 votes
1 answer
7k views

changing root password with an ansible playbook

It is with great difficulty that I resolved to solve my problem, so I allow myself to submit here the solution. I wanted a playbook that could replace on all hosts the root password with a string ...
MaxiReglisse's user avatar
1 vote
2 answers
184 views

Long-term archiving + encrypting shell script

Yesterday, I very quickly, in an hour, wrote the very first version of my long-term archiving + encrypting shell script. I am aware it may have too many flaws, but none of them really prevent it from ...
Vlastimil Burián's user avatar
6 votes
2 answers
663 views

OpenSSL AES GCM Convenience Wrapper in C

I wrote this code for inclusion in a repository of encryption code examples. The cryptographic primitives in use are required for compatibility with the other code samples. It's been a long while ...
Luke Park's user avatar
  • 255
4 votes
1 answer
2k views

Optimizing MD5 OpenSSL Implementation in C for Precomputed Hash

I am trying to port a piece of code from Python to C. What the code does is that it generates a list of precomputed MD5 hash from a plaintext wordlist. The code also has its variations in SHA-1 and ...
Algo7's user avatar
  • 178
1 vote
1 answer
144 views

Shell POSIX OpenSSL file decryption script follow-up #1

This question is the first follow-up of: Shell POSIX OpenSSL file decryption script Please read it before you continue reading this. Thank you. I only have one new problem solved and I would like ...
Vlastimil Burián's user avatar
6 votes
1 answer
893 views

Shell POSIX OpenSSL file decryption script

Tonight, I tried to write a Bash OpenSSL file decryption script. Encryption script will follow in highly similar manner, so I think it's not necessary now. Let's suppose we have an encrypted large ...
Vlastimil Burián's user avatar
4 votes
0 answers
7k views

OpenSSL Client/Server

I have recently begun to dabble with OpenSSL to provide TLS encryption to TCP socket communication. Through documentation and heavy reference on example code I have come up with the following code (...
chadduffin's user avatar
2 votes
0 answers
615 views

Optimizing rc4 encryption

I am working on an rc4 encryption implementation for s3fs and I'd like to better optimize my design so I'd like feedback on my encryption/decryption here. Below is the code which accepts a file ...
Callat's user avatar
  • 203
1 vote
1 answer
979 views

encrypt/decrypt person data

Ahead of the General Data Protection Regulation (GDPR) I begin to crypt more than ever before, in fact, all I can crypt become crypt. However, I wonder if anybody can tell me if this code is secure ...
TheCrazyProfessor's user avatar
2 votes
0 answers
806 views

Wrapper/abstraction for encryption and decryption using OpenSSL

I am a beginner when it comes to cryptography and OpenSSL. I have written a short wrapper of some functions in OpenSSL as well as a test of this wrapper, copied below. Specifically, this code is ...
waynemystir's user avatar
7 votes
1 answer
248 views

Linux/Mac hashing SHA-1

To do password exchange on the SQL server I need to use SHA-1 to generate a hash (no plain password exchange). This is done differently on Linux/Mac so I abstracted it slightly. ThorCryptWrapper.h <...
Martin York's user avatar
  • 93.3k
4 votes
1 answer
176 views

IRC Client with TLS and SASL support

I wrote this little program to... I don't know. But it connects to IRC servers using OpenSSL and can login via SASL. The code needs refactoring, of that I'm certain, but I need some advice in that ...
Ezechiel's user avatar
  • 137
3 votes
1 answer
3k views

Converting to and from Base64 using OpenSSL API

I am trying to get a working and good version of base64 conversions using OpenSSL. My alternatives were an implementation from an answer on SO and Boost (which I didn't chose because I read that is ...
Andrei Damian's user avatar
2 votes
1 answer
88 views

Encrypting a user's file with a key that isn't stored but only known by the user

I want to make some kind of file vault. I want to store encrypted files in a MySQL table, and the key to encrypt/decrypt them is never stored but only known to the user (that's the goal, anyway). The ...
twharmon's user avatar
  • 303
3 votes
1 answer
2k views

TCP socket server using OpenSSL

I've written this basic TCP socket server that uses SSL. This is my first experience with sockets in C++. The client is a Qt desktop application. Code overview: Receive incoming connection. Check if ...
Babra Cunningham's user avatar
4 votes
1 answer
128 views

Password and shadow file mockup

I tried to implement something similar to the Linux shadow.txt file and I am not aware of concepts such as memory fingerprinting. Could someone please review this code? ...
Shubham Jain's user avatar
2 votes
1 answer
2k views

PHP function for encrypt / decrypt using openssl

This is a function that is the building block of one wordpress plugin. I came up with this code after some search but i need to optimize it and get any info from more experienced guys. ...
e4rthdog's user avatar
  • 143
7 votes
1 answer
301 views

Encrypt message for sending over non secure network

wRecently needed to swap keys with a colleague on the other side of the country. This script encrypts a file using the other persons public key that is stored on github. It outputs a script that will ...
Martin York's user avatar
  • 93.3k
8 votes
3 answers
23k views

Complete async OpenSSL example

I am trying to create a fully async example of a client and server using SSL. I think these are the required assumptions: Connecting may require socket readability and writeability notifications. ...
John Cashew's user avatar
2 votes
2 answers
1k views

Send and receive data code using OpenSSL

I need to send and receive data. Here is solution for my original problem. I want to know how safe my finished code is and how I can improve it. Here is my first try. Now I need to get review for my ...
Ufx's user avatar
  • 217
3 votes
2 answers
224 views

Send and receive data code

I need to send and receive data. Here is solution for my original problem. I want to know how safe my finished code is and how I can improve it. ...
Ufx's user avatar
  • 217
1 vote
1 answer
119 views

Making an HTTPS request more readable

I think the snippet is too nested having too many blocks. It needs to be refactored to make the logic more readable. The try exception is the first level block ...
user3675188's user avatar
1 vote
3 answers
2k views

Random String Generator using OpenSSL in PHP

...
Entimon's user avatar
  • 11
12 votes
1 answer
311 views

Bitcoin address validator in C

Here is a Bitcoin address validator I am looking to have reviewed in C. Normally I would have the enum and function prototypes declared in a header file, but I ...
syb0rg's user avatar
  • 21.8k
7 votes
1 answer
5k views

Let OpenSSL decide which TLS protocol version is used by default

I use Gem in a Box, a Ruby project that allows to create personal self-hosted gem repositories. Gem in a Box uses httpclient to connect to the gem repository. After ...
aef's user avatar
  • 171
7 votes
3 answers
114 views

Encrypt and backup folder to email daily, when online

I have a backup script which should backup a folder and send it to email. This should be done once a day. As this is on my laptop which is not online 24/7 I need to check that I am online and can send ...
Tomas Greif's user avatar
8 votes
2 answers
3k views

OpenSSL PBKDF2-HMAC-SHAx proof of concept

I have regrettably been away from C programming for a very long time, so I'd like to get a quick code review of a first proof of concept, before I get too far into adding capabilities, using the ...
Anti-weakpasswords's user avatar
11 votes
3 answers
2k views

Pi Benchmarking in C

I wrote the following program to calculate n digits of Pi (where n could be anything, like 10M) in order to benchmark the CPU and it works perfectly (without OpenMP): ...
noobprohacker's user avatar
6 votes
2 answers
7k views

HMAC-SHA1 implementation

I am trying out a small piece of code that would generate HMAC-SHA1. I have been asked to code the HMAC implementation myself using the OpenSSL libs for SHA1 calculation. After 'wiki'ing for the ...
user25528's user avatar
6 votes
1 answer
994 views

Adding trusted timestamps to Git commits

I don't write too many bash scripts and I can usually struggle my way through getting the odd thing I need working, but my scripts always seem to feel a bit brittle. Below is a script I wrote for ...
Ryan J's user avatar
  • 163
7 votes
4 answers
492 views

Making this password search more intelligent

In a homework, there is an exercise in which I have a script that is used to search for a password. One of the questions is if is possible to make it "more intelligent", and I'm stuck on it. ...
user674887's user avatar