nowfound

Dev tools · December 24, 2012

AI

An idiot-proof crypto library for Python 3 (feedback, please)

I really couldn't find a simple wrapper to pycrypto that would encrypt data correctly in Python 3. So I tried to follow the instructions at http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html (written by HN's cperciva) and wrote https://github.com/andrewcooke/simple-crypt Is that OK? Given the problems Tarsnap had with CTR mode, was it wrong to follow those instructions anyway? Have I got the offset handling right? It seemed like it would be better to write this once, get it revised here, and then publish it (I'll make an egg for pypi once it seems OK) than quietly…

An idiot-proof crypto library for Python 3 (feedback, please) launched on December 24, 2012 with 13 votes, #106 of 501 launches that month and more than 75% of that year's launches. The site was still online in September 2026, 13 years on.

Visit daemonology.net ↗Alternativestop 21% of December 2012

In plain words

Simple-crypt is a Python 3 encryption library that wraps PyCrypto to make secure data encryption straightforward. It uses AES in CTR mode with HMAC authentication to protect against tampering while avoiding common cryptographic pitfalls like padding vulnerabilities and side-channel attacks. The library is designed for developers who need reliable encryption without managing complex cryptographic details themselves.

written from the facts on this page · September 2026

From the sources

Encrypting data: Use AES in CTR (Counter) mode, and append an HMAC . AES is about as standard as you can get, and has done a good job of resisting cryptologic attacks over the past decade. Using CTR mode avoids the weakness of ECB mode, the complex (and bug-prone) process of padding and unpadding of partial blocks (or ciphertext stealing), and vastly reduces the risk of side channel attacks thanks to the fact that the data being input to AES is not sensitive. However, because CTR mode is malleable, you should always add an HMAC to confirm that the encrypted data has not been tampered with. In some situations it may be preferable for performance reasons to use a cipher mode such as GCM which…from daemonology.net

In the maker’s words, at launch

I really couldn't find a simple wrapper to pycrypto that would encrypt data correctly in Python 3. So I tried to follow the instructions at http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html (written by HN's cperciva) and wrote https://github.com/andrewcooke/simple-crypt Is that OK? Given the…

Does a similar job

all alternatives →

More dev tools this month

the category →
  • /dev/null▲481

    a social network for devs

    Dev tools · 2d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 27d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 25d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 22d ago · openbot.run

  • Talanoa▲341

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 20d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 28d ago · corespeed.io

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, December 2012

the whole month →