# eric7.Utilities.crypto.__init__

Package implementing cryptography related functionality.

### Global Attributes

CryptoMarker
Delimiter
EncodeMarker
MasterPassword

### Classes

None

### Functions

__getMasterPassword | Private module function to get the password from the user.
changeRememberedMaster | Module function to change the remembered master password.
dataDecrypt | Module function to decrypt a password.
dataEncrypt | Module function to encrypt a password.
pwConvert | Module function to convert a plaintext password to the encoded form or vice versa.
pwDecode | Module function to decode a password.
pwDecrypt | Module function to decrypt a password.
pwEncode | Module function to encode a password.
pwEncrypt | Module function to encrypt a password.
pwRecode | Module function to re-encode a password.
pwReencrypt | Module function to re-encrypt a password.

## __getMasterPassword

__getMasterPassword()

Private module function to get the password from the user.

Up

## changeRememberedMaster

changeRememberedMaster(newPassword)

Module function to change the remembered master password.

newPassword
  new password to be used (string)

Up

## dataDecrypt

dataDecrypt(edata, password, keyLength=32)

Module function to decrypt a password.

edata
  hashed data to decrypt (string)
password
  password to be used for decryption (string)
keyLength
  length of the key to be generated for decryption (16, 24 or 32)

Return:
  decrypted data (bytes) and flag indicating success (boolean)

Up

## dataEncrypt

dataEncrypt(data, password, keyLength=32, hashIterations=10000)

Module function to encrypt a password.

data
  data to encrypt (bytes)
password
  password to be used for encryption (string)
keyLength
  length of the key to be generated for encryption (16, 24 or 32)
hashIterations
  number of hashes to be applied to the password for generating the encryption key (integer)

Return:
  encrypted data (bytes) and flag indicating success (boolean)

Up

## pwConvert

pwConvert(pw, encode=True)

Module function to convert a plaintext password to the encoded form or vice versa.

If there is an error, an empty code is returned for the encode function or the given encoded password for the decode function.

pw
  password to encode (string)
encode
  flag indicating an encode or decode function (boolean)

Return:
  encoded or decoded password (string)

Up

## pwDecode

pwDecode(epw)

Module function to decode a password.

epw
  encoded password to decode (string)

Return:
  decoded password (string)

Up

## pwDecrypt

pwDecrypt(epw, masterPW=None)

Module function to decrypt a password.

epw
  hashed password to decrypt (string)
masterPW
  password to be used for decryption (string)

Return:
  decrypted password (string) and flag indicating success (boolean)

Up

## pwEncode

pwEncode(pw)

Module function to encode a password.

pw
  password to encode (string)

Return:
  encoded password (string)

Up

## pwEncrypt

pwEncrypt(pw, masterPW=None)

Module function to encrypt a password.

pw
  password to encrypt (string)
masterPW
  password to be used for encryption (string)

Return:
  encrypted password (string) and flag indicating success (boolean)

Up

## pwRecode

pwRecode(epw, oldPassword, newPassword)

Module function to re-encode a password.

In case of an error the encoded password is returned unchanged.

epw
  encoded password to re-encode (string)
oldPassword
  password used to encode (string)
newPassword
  new password to be used (string)

Return:
  encoded password (string)

Up

## pwReencrypt

pwReencrypt(epw, oldPassword, newPassword)

Module function to re-encrypt a password.

epw
  hashed password to re-encrypt (string)
oldPassword
  password used to encrypt (string)
newPassword
  new password to be used (string)

Return:
  encrypted password (string) and flag indicating success (boolean)

Up