In: Computer Science
Find out how can we use cryptography libraries in Python. Write down the steps to install cryptography library in Python.
Answer:
To use cryptography libraries - import cryptography
(or)
from cryptography.fernet import Fernet
To install cryptography on windows, simply open administrative command prompt and type -
$ pip install cryptography
To install cryptography on
Linux, cryptography
ships
manylinux
wheels (as of 2.0) so all dependencies are
included. For users on pip 8.1 or above running on a
manylinux1
or manylinux2010
compatible
distribution (almost everything except Alpine) all you should need
to do is:
$ pip install cryptography
If you are on Alpine or just want to compile it yourself then
cryptography
requires a compiler, headers for Python
(if you’re not using pypy
), and headers for the
OpenSSL and libffi
libraries available on your
system.
For Ubuntu, we need to type this command:-
$ sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
For CentOS-
$ sudo yum install redhat-rpm-config gcc libffi-devel python-devel \ openssl-devel
Let me know if you have any doubts or if you need anything to change. If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions. Thank You! ===========================================================================