wodny / decrypt-2fas-backup Goto Github PK
View Code? Open in Web Editor NEW2FAS app encrypted export decryption tool
2FAS app encrypted export decryption tool
Greetings,
Thanks for your work on this script.
I'm trying to decrypt an exported file from Google Authenticator app.
Requirements:
% uname -a
Linux wattpad 6.0.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 03 Nov 2022 18:01:58 +0000 x86_64 GNU/Linux
% python -V
Python 3.10.8
% pip3 install cryptography
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: cryptography in /usr/lib/python3.10/site-packages (38.0.3)
Requirement already satisfied: cffi>=1.12 in /usr/lib/python3.10/site-packages (from cryptography) (1.15.1)
Requirement already satisfied: pycparser in /usr/lib/python3.10/site-packages (from cffi>=1.12->cryptography) (2.21)
Executing the script:
% ./decrypt-2fas-backup.py mypass ~/Downloads/2fas-backup-20221107223516.2fas
Traceback (most recent call last):
File "/home/userspace/workspace/crypto/decrypt-2fas-backup/./decrypt-2fas-backup.py", line 51, in <module>
main()
File "/home/userspace/workspace/crypto/decrypt-2fas-backup/./decrypt-2fas-backup.py", line 46, in main
credentials_dec = aesgcm.decrypt(nonce, credentials_enc, None)
File "/usr/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/aead.py", line 210, in decrypt
return aead._decrypt(backend, self, nonce, data, [associated_data], 16)
File "/usr/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/aead.py", line 249, in _decrypt
raise InvalidTag
cryptography.exceptions.InvalidTag
Would you have any clue?
Thanks.
Kindly,
W
Hi Wodny, thanks for the great script. It's simple and easy to understand.
The call to PBKDF2HMAC needs an extra argument before the closing paren backend=default_backend()
so the script needs this extra import
from cryptography.hazmat.backends import default_backend
Thanks again for your great code
Best wishes
Rob Howell
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.