* work on new block system, encryption
+ added new exception + encryption now anonymous by default, will probably remove anonymous param in future
This commit is contained in:
parent
10ebdddb24
commit
0a8052a9a4
3 changed files with 17 additions and 1 deletions
|
|
@ -700,8 +700,20 @@ class Core:
|
|||
if len(symKey) < self.requirements.passwordLength:
|
||||
raise onionrexceptions.SecurityError('Weak encryption key')
|
||||
jsonMeta = self._crypto.symmetricEncrypt(jsonMeta, key=symKey, returnEncoded=True)
|
||||
data = self._crypto.symmetricEncrypt(data, key=symKey, returnEncoded=True)
|
||||
signature = self._crypto.symmetricEncrypt(signature, key=symKey, returnEncoded=True)
|
||||
signer = self._crypto.symmetricEncrypt(signer, key=symKey, returnEncoded=True)
|
||||
elif encryptType == 'asym':
|
||||
if self._utils.validatePubKey(asymPeer):
|
||||
jsonMeta = self._crypto.pubKeyEncrypt(jsonMeta, asymPeer, encodedData=True)
|
||||
data = self._crypto.pubKeyEncrypt(data, asymPeer, encodedData=True)
|
||||
signature = self._crypto.pubKeyEncrypt(signature, asymPeer, encodedData=True)
|
||||
else:
|
||||
raise onionrexceptions.InvalidPubkey(asymPeer + ' is not a valid base32 encoded ed25519 key')
|
||||
|
||||
metadata['meta'] = jsonMeta
|
||||
metadata['sig'] = signature
|
||||
metadata['signer'] = signer
|
||||
|
||||
powProof = onionrproofs.POW(data)
|
||||
powToken = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue