javax.crypto.BadPaddingException: Given final block not properly padded

martin.gardiner's Avatar

martin.gardiner

Jul 09, 2015 @ 01:02 PM

I keep my MD data file in Dropbox so that I can open MD on different PCs. I managed to corrupt / delete some of the files in the MD folder. I've used the Dropbox restore but I am still unable to open my MD data file.

I get a popup saying "javax.crypto.BadPaddingException: Given final block not properly padded" - see the attached screen shot. I've also attached the error log.

Can you suggest how I resolve this problem?

Thanks,

Martin.

  1. Support Staff 1 Posted by Ethan on Jul 09, 2015 @ 01:08 PM

    Ethan's Avatar

    Hello Martin,

    We've seen a few reports of this, but have yet to figure out exactly what is happening. I've spoken to our lead developer, and he has requested that I ask if you could be willing to share your yourfilename.moneydance data file that you are experiencing this with? He could then take a closer look at it, and try to figure out what exactly is going wrong. I've made this thread private, so only you and the support staff will be able to see anything in it.

    Ethan
    Moneydance Support

  2. 2 Posted by martin.gardiner on Jul 09, 2015 @ 01:14 PM

    martin.gardiner's Avatar

    Attached is an archive zip.

    Regards,

    Martin.

  3. 3 Posted by martin.gardiner on Jul 13, 2015 @ 08:53 AM

    martin.gardiner's Avatar

    Morning everyone,

    Has there been any progress on this?

    Thanks,

    Martin.

  4. 4 Posted by Ian L on Jul 15, 2015 @ 02:05 PM

    Ian L's Avatar

    Hi Martin,

    Sorry for the delay on this. We're still looking into the issue. You said you restored from Dropbox. Is there an older version you can restore from?

    Ian
    Infinite Kind Support

  5. Support Staff 5 Posted by Sean Reilly on Jul 15, 2015 @ 03:03 PM

    Sean Reilly's Avatar

    Hi Martin,

    It looks like this file was located in dropbox due to some internal "conflicted copy" files of the sort that dropbox creates when files are changed on two different computers. I believe that one of the internal files is out of sync with the rest of the data file. If you open up the data file (by control-clicking on the file in the Finder and selecting "Show Package Contents" from the popup) there is a file called "key" which contains an encrypted copy of the encryption key for the rest of the file. That file seems to not belong to the rest of the data file, because it doesn't work to decrypt the rest of the data.

    Is it possible that this file was changed or modified in some way? Is it possible, as Ian mentioned, to restore from a previous version of the data file in Dropbox? If the file is still in dropbox you can control-click on it in the Finder and select the "View Previous Versions" entry from the popup menu.

    Thanks,

    Sean Reilly
    Developer, The Infinite Kind
    http://infinitekind.com

  6. 6 Posted by martin.gardiner on Jul 17, 2015 @ 10:45 AM

    martin.gardiner's Avatar

    Thanks very much - that solved the problem with opening the MD file.

    However, it's not syncing correctly to my Galaxy. When I changed the key file and got MD to open on the PC syncing was disabled. I enabled it and the status bar flashed up saying sync complete - but it hasn't brought in the last couple of weeks from the phone.

    I'm not sure what the next step is as I don't want to make a mistake and have the PC sync down to the phone & lose the last several weeks,

    btw - I now have two guid folders in the .moneydancesync directory.

    Thanks,

    Martin.

  7. Support Staff 7 Posted by Sean Reilly on Jul 17, 2015 @ 10:57 AM

    Sean Reilly's Avatar

    Hi Martin,

    Ok, I'm glad that restoring the key file got the rest of the data loading again.

    Since there are two GUID folders under the sync folder I think your desktop and mobile device are each syncing with a different folder. In order to not lose any of the changes you should first make a complete backup copy of both folders as well as your desktop data file.

    Then, make sure that the syncing encryption passphrase (under the File->Syncing menu/window) is the same as it was when you setup syncing on the phone.

    Next, in a file browser, copy any files ending with .txn from one of the GUID folders to the other. There should only have been .txn files in one of the GUID folders. That would be the folder that the mobile device was using. Copying those .txn files to the other folder should cause the desktop Moneydance to pick them up and apply them to the desktop data.

    If the previous steps go as planned then your desktop data will be up-to-date with the changes made on your mobile. Once you confirm that is the case, disconnect moneydance syncing on your Galaxy (from the app's settings) and then re-setup syncing, making sure to select the more recent file.

    From then on the mobile device and the desktop should stay in sync.

    Thanks!
    Sean

  8. 8 Posted by martin.gardiner on Jul 17, 2015 @ 11:53 AM

    martin.gardiner's Avatar

    OK. Just before I do that - what's the data in the v2 subfolder?

    In the folder that the desktop created today there's a single file named trunk-201507171230.mdtxn. In the folder that I believe the galaxy is syncing to there is no file with this name pattern (trunk-*) but there are dozens of <guid>.mdtxn files. And if I look in Dropbox there are hundreds of similar files that have been deleted.

    Are any of these necessary?

    Thanks,

    Martin.

  9. Support Staff 9 Posted by Sean Reilly on Jul 17, 2015 @ 01:19 PM

    Sean Reilly's Avatar

    Hi Martin,

    Everything under the "v2" subfolder is created by Moneydance 2015 for the full desktop-to-desktop syncing that should be working, but isn't yet enabled in the interface.

    Everything that is used and created by the mobile device will be in the top level GUID folder (the one containing the v2 subfolder). The txn files (or maybe .mdtxn?) in that top level folder are the changes that are made by the mobile app and are the ones to be copied over.

    If you like, I'm available to work with you on this in a screen sharing session within the next 1.5 hours. Just let me know!

    Thanks,
    Sean

  10. 10 Posted by martin.gardiner on Jul 21, 2015 @ 09:30 AM

    martin.gardiner's Avatar

    Hi Sean, thanks very much for helping with this. Everything is now ok and syncing correctly via Dropbox.

    If you delete my data file from this thread then the issue can be made public again - it may help someone else.

    Thanks again,

    Martin.

  11. Support Staff 11 Posted by Sean Reilly on Jul 21, 2015 @ 10:48 AM

    Sean Reilly's Avatar

    Hi Martin,

    That's great! I've deleted the attachments and have marked this thread as completed.

    Sean Reilly
    Developer, The Infinite Kind
    http://infinitekind.com

  12. Sean Reilly closed this discussion on Jul 21, 2015 @ 10:48 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac