Code Monkey home page Code Monkey logo

Comments (2)

metroproxyn avatar metroproxyn commented on July 18, 2024

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.

metroproxyn avatar metroproxyn commented on July 18, 2024

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:

  1. 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).
  2. Cipher: A cipher is a cryptographic algorithm used for encryption and decryption. The cryptography library provides several cipher algorithms, including AES and Triple DES.
  3. 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.
  4. 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.
  5. 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:

  1. Import the necessary modules from the cryptography library.
  2. Define a function for generating a symmetric key.
  3. Define a function for generating an initialization vector (IV).
  4. Define a function for encrypting a message using a given key and IV.
  5. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.