Skip to main content

LibFcrypt

Simple, symmetric encryption. Courtesy of cryptography and Fernet.

Functions

Base

  • base.check_key(key): Check a key's (bytes) validity, returns a boolean.
  • base.gen_key(): Generate a bytes object key.
  • base.passwd_gen_key(passwd): Generate a bytes object key derived from a string.
  • base.encrypts(key,string): Encrypt a string using a key (bytes), returns a bytes object.
  • base.encryptb(key,dataBytes): Encrypt a bytes object using a key (bytes), returns a bytes object.
  • base.decrypts(key,string): Decrypt a bytes object using a key (bytes), returns a string.
  • base.decryptb(key,byteString): Decrypt a bytes object using a key (bytes), returns a bytes object.

File

  • file.encryptf(key,filePtr): Encrypt the contents of a file using a key (bytes), returns a bytes object.
  • file.encryptbf(key,filePtr): Encrypt the contents of a file using a key (bytes), returns a bytes object.
  • file.decryptf(key,filePtr): Decrypt the contents of a file using a key (bytes), returns a string.
  • file.decryptbf(key,filePtr): Decrypt the contents of a file using a key (bytes), returns a bytes object.

Variables

  • VERSION: Module version information, string.
  • LICENSE: Module licensing information, string.

Errors

  • errors.InvalidKey: Should be raised when base.check_key() returns False.

Installation

Git

git clone https://www.github.com/SrFluff/libfcrypt
cd libfcrypt
cp -r libfcrypt $PYTHONPATH

Pip

pip install libfcrypt
import libfcrypt

# Generate a key
key = libfcrypt.base.gen_key()

# Generate a key from a password
other_key = libfcrypt.base.passwd_gen_key("Password123")

# Encrypt a string
secrets = libfcrypt.base.encrypts(key,"I have so many secrets muahaha!")

# Encrypt a bytes object
bSecrets = libfcrypt.base.encryptb(key,b'ID3')

# Write secrets to a file
with open("Secrets.txt","wb") as f:
    f.write(secrets)

# Read secrets from a file

f = open("Secrets.txt","rb")
spilled_secrets = libfcrypt.file.decryptf(key,f)

# Spill secrets!

print(spilled_secrets)

Metadata

Release files for libfcrypt 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libfcrypt 1.2.0
File Size Uploaded
libfcrypt-1.2.0.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libfcrypt 1.2.0
File Interpreter ABI Platform
libfcrypt-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.6 kB

Release files / libfcrypt-1.2.0.tar.gz

Download URL libfcrypt-1.2.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4370a4cc39808b6a98410121cac7c6e64e97da731bc880291fab18696d3be7c0
BLAKE2b-256 checksum
How to use checksums
375b8ef9f65014d0abb878f903a2afc7259eb513f29bdb8dee0a1a6ed6d87579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / libfcrypt-1.2.0-py3-none-any.whl

Download URL libfcrypt-1.2.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb2e563502da6a53dfe7300843eaf43fe642b4db661594f41883f42ba69a52cc
BLAKE2b-256 checksum
How to use checksums
61ae873cdfa3d152df9349e1d66836eaca85183b635eb38b6ee9ae9ac2722bee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

1.2.2

2 release files

1.2.1

2 release files

This release

1.2.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page