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

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

Built distribution (wheel)

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

Total release size: 6.7 kB

Release files / libfcrypt-1.2.2.tar.gz

Download URL libfcrypt-1.2.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
28f2974162bb96932e722e8c982cf98178b824a04d402aa32bb4bf79b3637c99
BLAKE2b-256 checksum
How to use checksums
9e330ceb71982d5fcf659bb1182380fa73da996ba04faf853b123e228fa6bd86
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.2-py3-none-any.whl

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

This release

1.2.2 This release

2 release files

1.2.1

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