Comments (2)
The approximate look:
The encrypt()
method takes a password as input, encodes it to bytes, and encrypts it using the Fernet object. The resulting encrypted password is returned as bytes.
The decrypt()
method takes an encrypted password as input, decrypts it using the Fernet object, and decodes it to a string. The resulting decrypted password is returned as a string.
from passprotectorpy.
Before you start developing the encryption.py module using the cryptography library, here are some key concepts and functions that you should be familiar with:
- Symmetric-key encryption: This is a type of encryption where the same key is used for both encryption and decryption. The cryptography library provides support for several symmetric-key encryption algorithms, including Advanced Encryption Standard (AES) and Triple Data Encryption Standard (Triple DES).
- Cipher: A cipher is a cryptographic algorithm used for encryption and decryption. The cryptography library provides several cipher algorithms, including AES and Triple DES.
- Key: In symmetric-key encryption, a key is a piece of information used to encrypt and decrypt data. The cryptography library provides functions for generating keys for various symmetric-key encryption algorithms.
- Initialization Vector (IV): An IV is a random value used to ensure that two identical blocks of plaintext do not result in identical blocks of ciphertext. The cryptography library provides functions for generating IVs for various symmetric-key encryption algorithms.
- Padding: Padding is the process of adding extra bits to the end of a message to ensure that its length is a multiple of a certain block size. The cryptography library provides support for several padding algorithms, including PKCS#7 and ANSI X.923.
Here is a basic outline of the steps you can follow to develop the encryption.py module using the cryptography library:
- Import the necessary modules from the cryptography library.
- Define a function for generating a symmetric key.
- Define a function for generating an initialization vector (IV).
- Define a function for encrypting a message using a given key and IV.
- Define a function for decrypting a message using a given key and IV.
Once you have developed the encryption.py module, you can create a separate branch and cover it by tests using the unittest or pytest framework.
from passprotectorpy.
Related Issues (11)
- Add setup.py file
- Add main.py file HOT 1
- Second step – cover the encryption.py module by tests
- List the dependencies in a 'requirement.txt'
- Add File handling file
- User_Interface.py
- Add password_strength_checker.py file
- Add test for password_strength_checker.py
- Add test_passwords.txt file for test
- Test module for file_handling.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passprotectorpy.