GlitterWare/Passy

[Bug]: Cant import Backup

Closed this issue ยท 12 comments

Bug description

i had to reset my phone and made a passy backup before, now i cant import it

Expected outcome

importing my backup

Steps to reproduce

No response

Error log

Invalid argument(s): Invalid or corrupted pad block
#0      PKCS7Padding.padCount (package:pointycastle/paddings/pkcs7.dart:42)
#1      PaddedBlockCipherImpl.doFinal (package:pointycastle/padded_block_cipher/padded_block_cipher_impl.dart:112)
#2      PaddedBlockCipherImpl.process (package:pointycastle/padded_block_cipher/padded_block_cipher_impl.dart:74)
#3      AES.decrypt (package:encrypt/src/algorithms/aes.dart:63)
#4      Encrypter.decryptBytes (package:encrypt/src/encrypter.dart:25)
#5      Encrypter.decrypt (package:encrypt/src/encrypter.dart:31)
#6      Encrypter.decrypt64 (package:encrypt/src/encrypter.dart:41)
#7      decrypt (package:passy/passy_data/common.dart:226)
#8      new EncryptedJsonFile.fromFile (package:passy/passy_data/encrypted_json_file.dart:37)
#9      AccountSettings.fromFile (package:passy/passy_data/account_settings.dart:63)
#10     new LoadedAccount.fromDirectory (package:passy/passy_data/loaded_account.dart:179)
#11     loadLegacyAccount (package:passy/passy_data/legacy/legacy.dart:104)
#12     PassyData.restoreAccount (package:passy/passy_data/passy_data.dart:384)
<asynchronous suspension>
#13     _ConfirmRestoreScreen.build.<anonymous closure>.<anonymous closure> (package:passy/screens/confirm_restore_screen.dart:49)
<asynchronous suspension>

App version

v1.7.0 - Better Synchronization

Submission checklist

  • I have specified the problem in the issue title
  • I have provided a verbose description of the problem

Hello @TommyVirus ! I am sorry to hear that.

I have checked the restore feature on my end recently and it does work so don't worry, there most probably is a way for us to restore your account.

Are you sure that you've entered your account password correctly? Invalid or corrupted pad block means that the decryption process has failed, usually because you entered a wrong password.

If your backup was created in an older Passy version without key derivation enabled then you might want to try Passy 1.6.0 for importing your account.

If you have a desktop computer (or a laptop), try unpacking your account folder from your backup zip into Documents/Passy/accounts and logging in via the desktop app.

If none of these options work, don't worry, I'll keep trying my best to attempt our successful recovery of your account.

Good luck!

Hello again @TommyVirus . I doubt that this is the case, but is there a chance that your password is longer than 32 characters?. If it is, try trimming it down to 32 characters and seeing if that works.

I have just found a redundant restriction in Passy's login and create account screens that only allow 32 characters due to an old limitation (resolved in c7d78cc).

thank you very much for your quick response, it was indeed that i entered the wrong password, but tought my backup was corrupted because of the error log. now everything works fine and thank you for your great work

No problem, I am very happy to hear that!

I will consider adding more human-friendly responses error codes for the restore process in the foreseeable future.

I hope that you enjoy Passy! As always, feel free to suggest features and report any issues.

Just going to comment here and say that unpacking the .zip archive and then moving the account folder to /home/Documents/Passy/accounts/, followed by logging out of my local passy account and then logging in to the backed up account worked flawlessly for me. For some reason when I was doing a passy import and then entering the correct password I would get an error (unfortunately I didn't save it anywhere before logging in so I can't share it here, sorry)

Hello @promitheas17j ! It is indeed possible to unpack the zip to restore an account when using the desktop app.

Is your password more than 32 characters long? Keep in mind that Passy's account creation and login screens used to trim the master password to 32 characters but that's not the case anymore in the latest version, so if you have any problems with logging in, try trimming your password to 32 characters.

No, my password is less than 32 characters

How odd, I can only guess that you might've entered it incorrectly, as the password verification code is very similar to that on the login screen.

I will try it again when I get home, at the very least to be able to share the entire error message here for you. If there is anything else you think might help track the issue down, please do let me know what to do and I will do my best to help!

Thanks for the prompt reply :)

I backed up my data to my PC, logged out, created a new test account, and tried to do Passy import using the saved .zip file. Here is the error log generated:

Invalid argument(s): Key length not 128/192/256 bits.
#0      AESEngine.generateWorkingKey (package:pointycastle/block/aes.dart:1164)
#1      AESEngine.init (package:pointycastle/block/aes.dart:1151)
#2      SICStreamCipher.init (package:pointycastle/stream/sic.dart:55)
#3      StreamCipherAsBlockCipher.init (package:pointycastle/adapters/stream_cipher_as_block_cipher.dart:29)
#4      PaddedBlockCipherImpl.init (package:pointycastle/padded_block_cipher/padded_block_cipher_impl.dart:47)
#5      AES.encrypt (package:encrypt/src/algorithms/aes.dart:35)
#6      Encrypter.encryptBytes (package:encrypt/src/encrypter.dart:12)
#7      Encrypter.encrypt (package:encrypt/src/encrypter.dart:20)
#8      encrypt (package:passy/passy_data/common.dart:217)
#9      _ConfirmImportScreen._onConfirmPressed (package:passy/screens/confirm_import_screen.dart:57)
<asynchronous suspension>

I am for sure writing the correct password for the original account (not the test one)

Hello again @promitheas17j !

I see that you are restoring your account via the import screen. If you have backed up your Passy account using the Backup and Restore screen then you will be able to restore it there as well.

The Passy import feature is for legacy unencrypted Passy exports only, it does not work for restoring Passy backups, use Backup and Restore instead.

I see, i wasnt aware of that. Thanks!