PyCrypto Alternatives - Python Cryptography | LibHunt (2024)

⚠️ WARNING
PyCrypto 2.x is unmaintained, obsolete, and contains security vulnerabilities. See https://www.pycrypto.org/ for details. The following is provided for historical/reference purposes only.

<!--If that site is no longer available, you can also look at index.md in thewww.pycrypto.org branch of this repository. The old generated docs andmailing list archive can also be found there.-->

Python Cryptography Toolkit (pycrypto)

This is a collection of both secure hash functions (such as SHA256 andRIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal,etc.). The package is structured to make adding new modules easy.This section is essentially complete, and the software interface willalmost certainly not change in an incompatible way in the future; allthat remains to be done is to fix any bugs that show up. If youencounter a bug, please report it in the GitHub issue tracker athttps://github.com/dlitz/pycrypto/issues

An example usage of the SHA256 module is:

>>> from Crypto.Hash import SHA256>>> hash = SHA256.new()>>> hash.update('message')>>> hash.digest()'\xabS\n\x13\xe4Y\x14\x98+y\xf9\xb7\xe3\xfb\xa9\x94\xcf\xd1\xf3\xfb"\xf7\x1c\xea\x1a\xfb\xf0+F\x0cm\x1d'

An example usage of an encryption algorithm (AES, in this case) is:

>>> from Crypto.Cipher import AES>>> obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')>>> message = "The answer is no">>> ciphertext = obj.encrypt(message)>>> ciphertext'\xd6\x83\x8dd!VT\x92\xaa`A\x05\xe0\x9b\x8b\xf1'>>> obj2 = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')>>> obj2.decrypt(ciphertext)'The answer is no'

One possible application of the modules is writing secureadministration tools. Another application is in writing daemons andservers. Clients and servers can encrypt the data being exchanged andmutually authenticate themselves; daemons can encrypt private data foradded security. Python also provides a pleasant framework forprototyping and experimentation with cryptographic algorithms; thanksto its arbitrary-length integers, public key algorithms are easilyimplemented.

As of PyCrypto 2.1.0, PyCrypto provides an easy-to-use random numbergenerator:

>>> from Crypto import Random>>> rndfile = Random.new()>>> rndfile.read(16)'\xf7.\x838{\x85\xa0\xd3>#}\xc6\xc2jJU'

A stronger version of Python's standard "random" module is alsoprovided:

>>> from Crypto.Random import random>>> random.choice(['dogs', 'cats', 'bears'])'bears'

Caveat: For the random number generator to work correctly, you mustcall Random.atfork() in both the parent and child processes afterusing os.fork()

Installation

PyCrypto is written and tested using Python version 2.1 through 3.3. Python1.5.2 is not supported.

The modules are packaged using the Distutils, so you can simply runpython setup.py build to build the package, and "python setup.pyinstall" to install it.

Linux installation requires the Python developer tools to be installed. Thesecan be found in the python-dev package on Debian/Ubuntu and thepython2-devel package on Red Hat/Fedora. If you are using a non-standardPython version for your distribution, you may require a different package.Consult your package manager's documentation for instructions on how toinstall these packages. Other distributions may have different package names.

To verify that everything is in order, run python setup.py test. Itwill test all the cryptographic modules, skipping ones that aren'tavailable. If the test script reports an error on your machine,please report the bug using the bug tracker (URL given above). Ifpossible, track down the bug and include a patch that fixes it,provided that you are able to meet the eligibility requirements at[https://www.pycrypto.org/submission-requirements/].

It is possible to test a single sub-package or a single module only, for instancewhen you investigate why certain tests fail and don't want to run the wholesuite each time. Use python setup.py test --module=name, where 'name'is either a sub-package (Cipher, PublicKey, etc) or a module (Cipher.DES,PublicKey.RSA, etc).To further cut test coverage, pass also the option --skip-slow-tests.

To install the package under the site-packages directory ofyour Python installation, run python setup.py install.

If you have any comments, corrections, or improvements for thispackage, please report them to our mailing list, accessible via thePyCrypto website:

https://www.pycrypto.org/https://www.dlitz.net/software/pycrypto/

PyCrypto Alternatives - Python Cryptography | LibHunt (2024)
Top Articles
AB Trust
Top 10 Short Term Finance Courses in India - 2024 | Zell
Kmart near me - Perth, WA
Melson Funeral Services Obituaries
Lorton Transfer Station
Terrorist Usually Avoid Tourist Locations
Farepay Login
Wausau Marketplace
Women's Beauty Parlour Near Me
What's Wrong with the Chevrolet Tahoe?
Spelunking The Den Wow
C-Date im Test 2023 – Kosten, Erfahrungen & Funktionsweise
Discover Westchester's Top Towns — And What Makes Them So Unique
Cooking Fever Wiki
Help with Choosing Parts
House Party 2023 Showtimes Near Marcus North Shore Cinema
2 Corinthians 6 Nlt
Canvas Nthurston
Transfer and Pay with Wells Fargo Online®
Noaa Ilx
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
Terry Bradshaw | Biography, Stats, & Facts
3 2Nd Ave
Olivia Maeday
Craigslist Wilkes Barre Pa Pets
Regina Perrow
Lovindabooty
Xpanas Indo
12657 Uline Way Kenosha Wi
Jersey Shore Subreddit
Alternatieven - Acteamo - WebCatalog
Progressbook Newark
Shiftwizard Login Johnston
9781644854013
Property Skipper Bermuda
Ise-Vm-K9 Eol
Craigslist Pa Altoona
Complete List of Orange County Cities + Map (2024) — Orange County Insiders | Tips for locals & visitors
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
The Realreal Temporary Closure
Man Stuff Idaho
Tinfoil Unable To Start Software 2022
Is Ameriprise A Pyramid Scheme
Sound Of Freedom Showtimes Near Amc Mountainside 10
Frontier Internet Outage Davenport Fl
Backpage New York | massage in New York, New York
Bf273-11K-Cl
Guy Ritchie's The Covenant Showtimes Near Look Cinemas Redlands
Naomi Soraya Zelda
Fishing Hook Memorial Tattoo
Latest Posts
Article information

Author: Twana Towne Ret

Last Updated:

Views: 6534

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Twana Towne Ret

Birthday: 1994-03-19

Address: Apt. 990 97439 Corwin Motorway, Port Eliseoburgh, NM 99144-2618

Phone: +5958753152963

Job: National Specialist

Hobby: Kayaking, Photography, Skydiving, Embroidery, Leather crafting, Orienteering, Cooking

Introduction: My name is Twana Towne Ret, I am a famous, talented, joyous, perfect, powerful, inquisitive, lovely person who loves writing and wants to share my knowledge and understanding with you.