From RFC 4880 [1]:
Octet 0: 0x01
Octet 1: hash algorithm
Octets 2-9: 8-octet salt value
[1]: http://tools.ietf.org/search/rfc4880#section-3.7.1.2
self['string-to-key-hash-algorithm'] = self._hash_algorithms[
data[offset]]
offset += 1
+ elif self['string-to-key-type'] == 'salted':
+ self['string-to-key-hash-algorithm'] = self._hash_algorithms[
+ data[offset]]
+ offset += 1
+ self['string-to-key-salt'] = data[offset: offset + 8]
+ offset += 8
else:
raise NotImplementedError(
'string-to-key type {}'.format(self['string-to-key-type']))