Esempio n. 1
0
 def generate_kd(self, password: bytes or str, salt: bytes or str) -> bytes:
     dk = KDF.scrypt(password, salt, self.__dk_len, self.__n, self.__r,
                     self.__p)
     return dk
 def generate_kd(self, password: str, salt: str):
     dk = KDF.scrypt(password, salt, self.dkLen, self.n, self.r, self.p)
     return dk
Esempio n. 3
0
 def generate_kd(self, password: str, salt: str):
     dk = KDF.scrypt(password, salt, self.__dk_len, self.__n, self.__r,
                     self.__p)
     return dk
Esempio n. 4
0
        "--passphrase",
        help="Pssphrase as an ASCII string to use to generate an encryption key"
    )
    parser.add_argument(
        "--salt",
        help=
        "Salt to use with KDF for generating a key from a passphrase. Must be a 128-bit hex string beginning with 0x"
    )
    parser.add_argument("--metadata_file",
                        help="File to hold metadata",
                        required=True)
    args = parser.parse_args()
    encryption_key = ''
    print "Starting key"
    if args.encryption_key is not None:
        encryption_key = binascii.unhexlify(args.encryption_key)
    else:
        if args.salt is None:
            print "A salt is required when using a passphrase"
            sys.exit(-1)
        encryption_key = KDF.scrypt(args.passphrase, args.salt, 16, 16384, 8,
                                    1)
    print "Finished with Key"
    FUSE(EncryptedFS(args.storage_dir, encryption_key, args.metadata_file),
         args.mount_point,
         nothreads=True,
         foreground=True,
         big_writes=True,
         max_read=1000000000,
         max_write=1000000000)
Esempio n. 5
0
 def generate_kd(self, password: bytes, salt: bytes):
     dk = KDF.scrypt(password, salt, self.dk_len, self.n, self.r, self.p)
     return dk