Skip to main content

Easy OpenSSL Utilities

Project description

easy-openssl

Encryption

import json
import datetime
import socket
import easyssl

hostname = socket.gethostname()
time_stamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
k = easyssl.Key()
k.load_pubkey()

plain_text = hostname + '__-__' + time_stamp
plain_text = json.dumps(
    {
        'k1': 'v1',
        'k2': 'v2',
        'k3': 'v3',
    }
)

k.encrypt(plain_text=plain_text)

Decryption

import json
import datetime
import socket
import easyssl

k = easyssl.Key()
k.load_prikey()


encrypted_text = 'F/IicdulrsDfrTsrR7ainjM23+kV8/7Li7pbLb/Zn6VGJD4Y9Nz18f4rb7WCW7di1TIzr+qTpY8nAI4DbphCC3FfGrIYgoBY0pCuzOng79R/Rrpgm4VIHbiGdssP7W1ihsksgd4ttcG9KR7GfJeeGaOlK5w1vl/9inveuUB8hQA4bhmrpEK/+HmYxXPtVadW3ZqRNf8wyGJwED63d1U7N7iO6Q5Rph2t1hmVKKRZ9uTeeAno1oo2a2N6xQ1IiwUkqsjggYkiLbCjm28/lony/2QtqvSdEzOmHzlTFeamcZqN5zxrkh2ozq07kJo6xibpN0EMSSgBZUaTLG2WtGbvoA=='
k.decrypt(encrypted_text)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyssl-1.0.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

easyssl-1.0.1-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page