Skip to main content

What Does Simple Crypt Do?

Simple Crypt encrypts and decrypts data. It has two functions, encrypt and decrypt:

from simplecrypt import encrypt, decrypt
ciphertext = encrypt('password', plaintext)
plaintext = decrypt('password', ciphertext)

That’s it. You can see the implementation on github.

Why Should I Use Simple Crypt?

  • It uses standard, well-known algorithms, closely following the recommendations here.

  • The established, efficient pycrypto library provides the algorithm implementations (the cipher used is AES256).

  • It includes a check (an HMAC with SHA256) to warn when ciphertext data are modified.

  • It tries to make things as secure as possible when poor quality passwords are used (PBKDF2 with SHA256, a 256 bit random salt (increased from 128 bits in release 3.0.0), and 100,000 rounds (increased from 10,000 in release 4.0.0)). But that doesn’t mean you should use a poor password!

  • Using a library, rather than writing your own code, means that we have less solutions to the same problem. That means more chance of finding bugs, which means more reliable, more secure code.

  • If simple-crypt does have a bug, the use of a header in the ciphertext data will help support an upgrade path (I can’t promise full backwards support, because any solution will depend on the attack, but at least the needed information is present).

What Else Should I Know?

  • You must also install pycrypto. Note that pycrypto has parts written in C so requires a full python install. On some unix systems that may mean adding a package like python-dev from your package manager.

  • In Python 3 the outputs from encrypt and decrypt are bytes. If you started with string input then you can convert the output from decrypt using .decode('utf8').

mystring = decrypt('password', ciphertext).decode('utf8')
  • Later versions can decrypt data from previous versions, but data encrypted by later (major) versions cannot be decrypted by earlier code (instead, an error is raised asking the user to update to the latest version).

  • (c) 2012-2015 Andrew Cooke, andrew@acooke.org; 2013 d10n, david@bitinvert.com. Released into the public domain for any use, but with absolutely no warranty.

Release files for simple-crypt 4.1.4

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

Source distribution (sdist)

Source distribution for simple-crypt 4.1.4
File Size Uploaded
simple-crypt-4.1.4.tar.gz 10.5 kB Details

Release files / simple-crypt-4.1.4.tar.gz

Download URL simple-crypt-4.1.4.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
402e1016256db636610a5d579d61456ab5ab370524eae76bcd574a35d9246430
BLAKE2b-256 checksum
How to use checksums
15d75e3772e0dea4904d9a3ebe6be31a5a4c1c5d0f758e56b279d7510f8ea334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

4.1.7

1 release file

4.1.6

1 release file

4.1.5

1 release file

This release

4.1.4 This release

1 release file

4.1.3

1 release file

4.1.2

1 release file

4.1.1

1 release file

4.1.0

1 release file

4.0.0

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.0.0

1 release file

0.2.0

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

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