implemented derived passwords
This commit is contained in:
@@ -9,13 +9,12 @@ import os, struct, time, hashlib, hashlib, random, binascii
|
||||
|
||||
|
||||
class EncryptedScreenshot:
|
||||
def __init__(self, metadata,id=None,signer=None,password_encryptor=None):
|
||||
def __init__(self, metadata,password=None,id=None,signer=None,password_encryptor=None):
|
||||
def rand(len):
|
||||
return ''.join(
|
||||
random.choice("1234567890ABCDEFGHIJKLMNOPQRSTUWVXYZabcdefghijklmnopqrstuwvxyz") for _ in range(len))
|
||||
|
||||
self.password = rand(16)
|
||||
print("Passphrase %s" % binascii.hexlify(self.passphrase()))
|
||||
self.password = (password or rand(16))
|
||||
self.id = id
|
||||
if id is None:
|
||||
self.id = rand(8)
|
||||
@@ -60,7 +59,8 @@ class EncryptedScreenshot:
|
||||
fields = {
|
||||
"image": encrypted_image,
|
||||
"metadata_encryption": self.metadata_encryption,
|
||||
"metadata": encrypted_metadata if self.metadata_encryption else self.metadata
|
||||
"metadata": encrypted_metadata if self.metadata_encryption else self.metadata,
|
||||
"public_metadata": self.metadata["public"]
|
||||
}
|
||||
|
||||
if self.signer is not None:
|
||||
|
Reference in New Issue
Block a user