sysPass / syspass-decrypter

An standalone tool for decrypting sysPass exported XML files
GNU General Public License v3.0
6 stars 6 forks source link

Error decrypting data (Ciphertext has invalid hex encoding) #9

Open kolsan opened 2 years ago

kolsan commented 2 years ago

Hello!!

When i try to see what it is inside my syspass backup, i find that it is not working. Please some could help me?

this is the behaviour:

admin@srv:~$ ./syspass-decrypter.phar spd:search-account --xmlpath ./syspass.xml

XML password:

xxxxxx

Master password:

xxxxxxxxxxxxxxx

[info] initialize [info] Reading XML file "./syspass.xml" [info] checkFile [info] readXMLFile [info] Encrypted XML detected [info] Processing encrypted data [error] Ciphertext has invalid hex encoding. [error] #0 phar:///home/syspass-decrypter.phar/lib/SPDecrypter/Services/XmlReader/XmlParser.php(100): SPDecrypter\Services\XmlReader\XmlParser->processEncrypted()

1 phar:///home/syspass-decrypter.phar/lib/SPDecrypter/Commands/SearchAccountCommand.php(119): SPDecrypter\Services\XmlReader\XmlParser->initialize()

2 phar:///home/syspass-decrypter.phar/vendor/symfony/console/Command/Command.php(255): SPDecrypter\Commands\SearchAccountCommand->execute()

3 phar:///home/syspass-decrypter.phar/vendor/symfony/console/Application.php(921): Symfony\Component\Console\Command\Command->run()

4 phar:///home/syspass-decrypter.phar/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()

5 phar:///home/syspass-decrypter.phar/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()

6 phar:///home/syspass-decrypter.phar/lib/SPDecrypter/bootstrap.php(48): Symfony\Component\Console\Application->run()

7 phar:///home/syspass-decrypter.phar/cli.php(27): require('phar:///home/ad...')

8 /home/syspass-decrypter.phar(14): require('phar:///home/ad...')

9 {main}

[error] Error decrypting XML data

MortenVinding commented 2 years ago

Same problem for me.

I tried the sysPass-XML-Decrypter and it works, but I would rather use this.

We are in the process of switching from Keepass and the ability to make offline backups to run from a USB stick is paramount to us, sine in a all-systems-down situation we really have to have access to the password database.

Tried to change the master password didn't help. Maybe some entries in our database is malformed?

MortenVinding commented 2 years ago

Tried to change the master password didn't help. Maybe some entries in our database is malformed?

turned out the reason was we have some password entries without a name! If the export/backup is without a password you can just edit the xml file and add a name for those entries: cat syspass.xml | sed 's:<name/>:<name>No name set</name>:g' > syspass-w-names.xml

MortenVinding commented 2 years ago

also it might be worth mentioning that you DON'T need the master password to search the database and show the entries. only to decrypt the passwords.

so if you just want to browse the database, or check your xml export, just hit enter on the master password prompt.

dariox64 commented 2 years ago

Change line 138 in file /lib/SPDecrypter/Services/XmlReader/XmlParser.php

replace $decode = Version::checkVersion($version, '320.0'); to $decode = true;

kolsan commented 2 years ago

Thanks for your answer I have done the change but still not work, same error

kolsan commented 2 years ago

also it might be worth mentioning that you DON'T need the master password to search the database and show the entries. only to decrypt the passwords.

so if you just want to browse the database, or check your xml export, just hit enter on the master password prompt.

Hello Finally you were able to solve this issue??

MortenVinding commented 2 years ago

Hello Finally you were able to solve this issue??

What? I did as I wrote and added names to the xml file.

spisoptic commented 1 year ago

Hi there.

Same error here anybody has managed to make it work?

Thanks!

unodea commented 1 year ago

no one were able to solve this issue?

duven87 commented 1 year ago

Change line 138 in file /lib/SPDecrypter/Services/XmlReader/XmlParser.php

replace $decode = Version::checkVersion($version, '320.0'); to $decode = true;

It worked for me, thank you very much with syspass xml decripter I have not been able to make the export... the passwords are not visible. The other things (notes, url, etc) are visible. This is what happens to me: https://gitlab.com/MagicFab/sysPass-XML-Decrypter/-/issues/2

And this program only serves to consult? can not I export everything in a csv/xml to keepass?