Module refinery.units.crypto.keyderive.hmac
Expand source code Browse git
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from refinery.units.crypto.keyderive import KeyDerivation
class hmac(KeyDerivation):
"""
HMAC based key derivation
"""
def __init__(self, salt, hash='SHA1', size=None):
super().__init__(salt=salt, size=size, hash=hash)
def process(self, data):
from Cryptodome.Hash import HMAC
return HMAC.new(data, self.args.salt, digestmod=self.hash).digest()
Classes
class hmac (salt, hash='SHA1', size=None)
-
HMAC based key derivation
Expand source code Browse git
class hmac(KeyDerivation): """ HMAC based key derivation """ def __init__(self, salt, hash='SHA1', size=None): super().__init__(salt=salt, size=size, hash=hash) def process(self, data): from Cryptodome.Hash import HMAC return HMAC.new(data, self.args.salt, digestmod=self.hash).digest()
Ancestors
Class variables
var required_dependencies
var optional_dependencies
Inherited members