This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Cannot "SAVE AS" an encrypted file

Tags: None
(comma "," separated)
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
Next step: Assuming your saved as file is called grossi.xml (In case it is not called grossi.xml but grossi.kmy convert it first with
Code: Select all
zcat grossi.kmy > grossi.xml
can you try to encrypt it using the following commands
Code: Select all
gpg -a -e -r <your-key-id-here> grossi.xml
mv grossi.xml.asc grossi.kmy
Replace <your-key-id-here> with an identifier that allows gpg to get the key that you use from within KMyMoney (e.g. numeric key id or e-mail address)
Check that the file in fact is encrypted with
Code: Select all
head grossi.kmy
which should show something like that (I simply used my file here)
Code: Select all
thb@thb-nb:~$ head thb.kmy
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: http://www.net-bembel.de/

hQEOA4WWinDR+DwrEAQAj647wwn/qKB9vK9gew7aw/+VGzOL7AuPql8UrjgeQf48
1pY1fpYTNznLna0rmMUP1sqB7z2BPRwVt40NCM0e12iM0VAOL2dm4OLJc+OdPF1X
TAoGpr/FB10twejnNiB74cDqfRS0ZJs8XnsnBm6hl7v+9C8Dsa7efh989rgnSF8D
/j4GkBB+wvDyKY/fxnzJra5sBa7zvz9/LpGCTJgm0ieiLaAnjwN57HO/vA3h1EnW
96j5AcSkJMOJ51jtqVbvF18UAqvhOgBDV53qM1Hc7hdlLPeI+uaXaoBmc5zF7c/D
i3TQL2l1ErHinAca7WziPYqKvO7CiX5oI4221xQP+COQ0u0BJTEzk3O85rShl1kf
In case it does not start with the BEGIN PGP MESSAGE it is probably not encrypted.

Then try loading it into KMyMoney with
Code: Select all
kmymoney grossi.kmy
and check if that works at all. Can you change something and save it and it stays encrypted? Do any warning/error messages show up?
I know, pretty lengthy stuff, but I have no idea where to start and try to get a few indications. Hope the instructions are clear for you to understand. If not, please ask.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
grossi
Registered Member
Posts
11
Karma
0
Many many many thanks Thomas o) , with your indications I solved the rebus !

So, I follow your advise, but when I try to encrypt a scratch file "grossi.xml"
Code: Select all
gianmario@debian-acer:~$ gpg -a -e -r gianmario grossi.xml
gpg: 8C15E2AA5DD73968: saltata: chiave pubblica non trovata
gpg: grossi.xml: encryption failed: chiave pubblica non trovata

Very strange: the public key is not found; so I give this command
Code: Select all
gpg --list-keys
/home/gianmario/.gnupg/pubring.gpg
----------------------------------
pub   1024D/D2B08440 2005-01-03 [expires: 2015-01-03]
uid                  KMyMoney emergency data recovery <kmymoney-recover@users.sourceforge.net>
sub   2048g/8C0FE2F3 2005-01-03 [expires: 2015-01-03]

pub   1024D/42C872BB 2013-12-27 [expires: 2014-12-27]
uid                  Gianmario Rossi <gianmario.rossi63@gmail.com>
sub   1024g/02DB0F30 2013-12-27 [expires: 2014-12-27]

My public key is still present and I don't understand what happend; I check my "$HOME/.gnupg/gpg.conf" and I have
found at the end of the file theese lines
Code: Select all
# Try CERT, then PKA, then LDAP, then hkp://subkeys.net:
#auto-key-locate cert pka ldap hkp://subkeys.pgp.net

default-key  E903320142C872BB

encrypt-to  8C15E2AA5DD73968

The "default-key" is my exa-code key, but the last one I don't know what is so I put before a # to comment the line and
when a try to encrypt a file with the terminal now it works 8)
Code: Select all
gianmario@debian-acer:~$ gpg -a -e -r gianmario grossi.xml
gianmario@debian-acer:~$ head grossi.kmy
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1

hQEOAyUjhloC2w8wEAQAljIyOl1ehGv3cQe6lVezVORWWDDTBrwj5nOb9X+xSO3J
eZllTwFoSm5D+Dk2h27j68QOWUFRtIhboWNUpGC1ZvQlcI1qTJV67RJ9twpChxqg
y1sIvxY3u/z4A826OH58Vq7GO9JFrRObHibHZmtAU6wR24GuZjE/3m1tbNftv5cD
/A9C6pI+gurfaf3D9qsS25He8ZPVTrm9OTDIYjURmC+K0q++Y5GEbmIDb9V1YhaP
Ay5LHes5+XyM7vgMR39lS5gH/n4l4xBHg5hS+Vz4+y8Gj7Gr+PkN6furroRigWHG
+Sk4E9eKyPVAKT2c7XD1atineBTxdPcJM9k7HhVIARbb0uwBP4dML3EjH+faxoHv
xOk1mpfs1GZ4ZOio/0+aJ4R4cszghJI8eIqOFoBzMWIuNGv5HPY20q5Od/7kOzXq


After that I open KMymoney, I set the configuration to ecryption and when I use "save as" a new file with encryption
now is working !!!

I don't understand what happened but all my troubles due to a wrong line in my "gpg.conf" that I never edited >:( >:(

I change the subject with SOLVED; many many thanks to all for your attention
ftonello
Registered Member
Posts
2
Karma
0
I'm glad that you solved it.

But it would be nice if KMyMoney showed some user error or warning.
grossi
Registered Member
Posts
11
Karma
0
ftonello wrote:I'm glad that you solved it.
But it would be nice if KMyMoney showed some user error or warning.


Hallo Ftonello, I see your answere only today: I don't agree with your sentence because the reason of my troubbles was not for Kmymoney, but for GPG that generated a wrong code into the configuration file: i putted my head to the wall, but with the help of this amazing community they helped my to find the solution.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], q.ignora, watchstar