Coder Social home page Coder Social logo

decrypt-2fas-backup's People

Contributors

wodny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

decrypt-2fas-backup's Issues

Raise cryptography.exceptions.InvalidTag

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

Add default_backend to PBKDF2HMAC

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.