fix v1 decrypt debug message, update readme
This commit is contained in:
@@ -42,7 +42,7 @@ def send(args, api_client):
|
||||
|
||||
request = paste.getJSON()
|
||||
|
||||
if args.debug:
|
||||
if args.debug:
|
||||
print("Passphrase:\t{}".format(paste.getHash()))
|
||||
print("Request:\t{}".format(request))
|
||||
|
||||
@@ -103,7 +103,7 @@ def get(args, api_client):
|
||||
|
||||
version = result['v'] if 'v' in result else 1
|
||||
paste.setVersion(version)
|
||||
|
||||
|
||||
if version == 2:
|
||||
if args.debug: print("Authentication data:\t{}".format(result['adata']))
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ class Paste:
|
||||
).digest())
|
||||
|
||||
|
||||
@classmethod
|
||||
def __initializeCipher(self, key, iv, adata):
|
||||
from pbincli.utils import json_encode
|
||||
cipher = AES.new(key, AES.MODE_GCM, nonce=iv, mac_len=CIPHER_TAG_BYTES)
|
||||
@@ -126,7 +127,7 @@ class Paste:
|
||||
return b64encode(self._key) + digest.encode("UTF-8")
|
||||
else:
|
||||
return b64encode(self._key)
|
||||
|
||||
|
||||
|
||||
def __decompress(self, s):
|
||||
if self._version == 2 and self._compression == 'zlib':
|
||||
@@ -188,7 +189,7 @@ class Paste:
|
||||
|
||||
cipher_text = json_decode(self._data['data'])
|
||||
|
||||
if self._debug: print("Text:\t{}\n".format(data))
|
||||
if self._debug: print("Text:\t{}\n".format(cipher_text))
|
||||
|
||||
text = SJCL().decrypt(cipher_text, password)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user