Skip to content

Instantly share code, notes, and snippets.

View maverick193's full-sized avatar
💪
<strong>Grind to Greatness</strong>

Mohammed NAHHAS maverick193

💪
<strong>Grind to Greatness</strong>
View GitHub Profile
@maverick193
maverick193 / sign.sh
Created February 6, 2020 12:43 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem