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.1

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.1
File Size Uploaded
libfcrypt-1.2.1.tar.gz 2.9 kB Details

Built distribution (wheel)

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

Total release size: 6.7 kB

Release files / libfcrypt-1.2.1.tar.gz

Download URL libfcrypt-1.2.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
97915c72fd88c60f0084b4be28543787e07d50ef3b6776cfb61d6d35ed58b5f8
BLAKE2b-256 checksum
How to use checksums
6553880d7b23a4b43869f9becf5691148bdda925b851cf875a005963add12ffa
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.1-py3-none-any.whl

Download URL libfcrypt-1.2.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f26b613bdc998caa92894eaedb4c07c225337fd70c7e51f245cda5b7429c33e4
BLAKE2b-256 checksum
How to use checksums
93b868da6ce525faa5b8ae12d13e56268a8c215bf34e96b953d50f24177b441e
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

This release

1.2.1 This release

2 release files

1.2.0

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