How to convert gpg4win's binary to ascii, with Notepad++
up vote
1
down vote
favorite
I can reliably convert gpg4win's ascii to binary using Notepad++ option "Base64 Decode" (credit: James K Polk). Works every time.
But when I attempt the reverse, i.e. convert binary to ascii, it works sometimes and does not work other times. Here's how I'm doing it:
- Open the binary file in Notepad++ and select "Base64 Encode".
- Manually add the BEGIN/END PGP message lines (-----BEGIN PGP MESSAGE-----)
This works sometimes (i.e. gpg4win can decrypt the resulting file), but fails other times (gpg4win can't decrypt). I am careful to do it exactly the same way each time, making sure there are no white spaces, etc. But it only works sometimes.
How can I get it to work using Notepad++?
Note:
I can do the conversion using --enarmor, but I would like to be able to do it with Notepad++. Especially since I can get it to work sometimes, so I know it's possible, and maybe I'm missing a small piece.
encryption gnupg pgp openpgp gpg4win
add a comment |
up vote
1
down vote
favorite
I can reliably convert gpg4win's ascii to binary using Notepad++ option "Base64 Decode" (credit: James K Polk). Works every time.
But when I attempt the reverse, i.e. convert binary to ascii, it works sometimes and does not work other times. Here's how I'm doing it:
- Open the binary file in Notepad++ and select "Base64 Encode".
- Manually add the BEGIN/END PGP message lines (-----BEGIN PGP MESSAGE-----)
This works sometimes (i.e. gpg4win can decrypt the resulting file), but fails other times (gpg4win can't decrypt). I am careful to do it exactly the same way each time, making sure there are no white spaces, etc. But it only works sometimes.
How can I get it to work using Notepad++?
Note:
I can do the conversion using --enarmor, but I would like to be able to do it with Notepad++. Especially since I can get it to work sometimes, so I know it's possible, and maybe I'm missing a small piece.
encryption gnupg pgp openpgp gpg4win
1
With this approach I think you are having difficulties with characters that Notepad++ understands as end-of-line. I don't think this is viable.
– harrymc
Nov 14 at 17:25
1
I don't have access to a windows environment so I can't test gpg4win or Notepad++. However, using gpg I have verified that 1) gpg ignores whitespace except that the-----BEGIN PGP MESSAGE-----
must end in a newline and the-----END PGP MESSAGE-----
must be preceded by a newline. 2) You don't need a comment line, but if you do have one it must be terminated by a newline. 3) You don't need a checksum line, but if you have one it must be preceded by a newline and it must be the correct checksum.
– James K Polk
Nov 14 at 21:01
@james-k-polk. Hi James, I could get certutil and even openssl to work (had to add the BEGIN/END lines manually), but Notepad++ doesn't work for encoding. It's works every time for decoding though.
– get_going
Nov 15 at 0:21
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I can reliably convert gpg4win's ascii to binary using Notepad++ option "Base64 Decode" (credit: James K Polk). Works every time.
But when I attempt the reverse, i.e. convert binary to ascii, it works sometimes and does not work other times. Here's how I'm doing it:
- Open the binary file in Notepad++ and select "Base64 Encode".
- Manually add the BEGIN/END PGP message lines (-----BEGIN PGP MESSAGE-----)
This works sometimes (i.e. gpg4win can decrypt the resulting file), but fails other times (gpg4win can't decrypt). I am careful to do it exactly the same way each time, making sure there are no white spaces, etc. But it only works sometimes.
How can I get it to work using Notepad++?
Note:
I can do the conversion using --enarmor, but I would like to be able to do it with Notepad++. Especially since I can get it to work sometimes, so I know it's possible, and maybe I'm missing a small piece.
encryption gnupg pgp openpgp gpg4win
I can reliably convert gpg4win's ascii to binary using Notepad++ option "Base64 Decode" (credit: James K Polk). Works every time.
But when I attempt the reverse, i.e. convert binary to ascii, it works sometimes and does not work other times. Here's how I'm doing it:
- Open the binary file in Notepad++ and select "Base64 Encode".
- Manually add the BEGIN/END PGP message lines (-----BEGIN PGP MESSAGE-----)
This works sometimes (i.e. gpg4win can decrypt the resulting file), but fails other times (gpg4win can't decrypt). I am careful to do it exactly the same way each time, making sure there are no white spaces, etc. But it only works sometimes.
How can I get it to work using Notepad++?
Note:
I can do the conversion using --enarmor, but I would like to be able to do it with Notepad++. Especially since I can get it to work sometimes, so I know it's possible, and maybe I'm missing a small piece.
encryption gnupg pgp openpgp gpg4win
encryption gnupg pgp openpgp gpg4win
asked Nov 14 at 16:37
get_going
285
285
1
With this approach I think you are having difficulties with characters that Notepad++ understands as end-of-line. I don't think this is viable.
– harrymc
Nov 14 at 17:25
1
I don't have access to a windows environment so I can't test gpg4win or Notepad++. However, using gpg I have verified that 1) gpg ignores whitespace except that the-----BEGIN PGP MESSAGE-----
must end in a newline and the-----END PGP MESSAGE-----
must be preceded by a newline. 2) You don't need a comment line, but if you do have one it must be terminated by a newline. 3) You don't need a checksum line, but if you have one it must be preceded by a newline and it must be the correct checksum.
– James K Polk
Nov 14 at 21:01
@james-k-polk. Hi James, I could get certutil and even openssl to work (had to add the BEGIN/END lines manually), but Notepad++ doesn't work for encoding. It's works every time for decoding though.
– get_going
Nov 15 at 0:21
add a comment |
1
With this approach I think you are having difficulties with characters that Notepad++ understands as end-of-line. I don't think this is viable.
– harrymc
Nov 14 at 17:25
1
I don't have access to a windows environment so I can't test gpg4win or Notepad++. However, using gpg I have verified that 1) gpg ignores whitespace except that the-----BEGIN PGP MESSAGE-----
must end in a newline and the-----END PGP MESSAGE-----
must be preceded by a newline. 2) You don't need a comment line, but if you do have one it must be terminated by a newline. 3) You don't need a checksum line, but if you have one it must be preceded by a newline and it must be the correct checksum.
– James K Polk
Nov 14 at 21:01
@james-k-polk. Hi James, I could get certutil and even openssl to work (had to add the BEGIN/END lines manually), but Notepad++ doesn't work for encoding. It's works every time for decoding though.
– get_going
Nov 15 at 0:21
1
1
With this approach I think you are having difficulties with characters that Notepad++ understands as end-of-line. I don't think this is viable.
– harrymc
Nov 14 at 17:25
With this approach I think you are having difficulties with characters that Notepad++ understands as end-of-line. I don't think this is viable.
– harrymc
Nov 14 at 17:25
1
1
I don't have access to a windows environment so I can't test gpg4win or Notepad++. However, using gpg I have verified that 1) gpg ignores whitespace except that the
-----BEGIN PGP MESSAGE-----
must end in a newline and the -----END PGP MESSAGE-----
must be preceded by a newline. 2) You don't need a comment line, but if you do have one it must be terminated by a newline. 3) You don't need a checksum line, but if you have one it must be preceded by a newline and it must be the correct checksum.– James K Polk
Nov 14 at 21:01
I don't have access to a windows environment so I can't test gpg4win or Notepad++. However, using gpg I have verified that 1) gpg ignores whitespace except that the
-----BEGIN PGP MESSAGE-----
must end in a newline and the -----END PGP MESSAGE-----
must be preceded by a newline. 2) You don't need a comment line, but if you do have one it must be terminated by a newline. 3) You don't need a checksum line, but if you have one it must be preceded by a newline and it must be the correct checksum.– James K Polk
Nov 14 at 21:01
@james-k-polk. Hi James, I could get certutil and even openssl to work (had to add the BEGIN/END lines manually), but Notepad++ doesn't work for encoding. It's works every time for decoding though.
– get_going
Nov 15 at 0:21
@james-k-polk. Hi James, I could get certutil and even openssl to work (had to add the BEGIN/END lines manually), but Notepad++ doesn't work for encoding. It's works every time for decoding though.
– get_going
Nov 15 at 0:21
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Notepad++ is an editor for text files, which are files that end with special
binary characters that denote an end-of-line.
It will always think that your text-line is found between two end-of-line
characters, and will mostly ignore the end-of-line itself in its operations.
This has the potential to destroy the file when converting to Base64,
since Notepad++ will convert the text between the end-of-lines, but may
cause a problem with not correctly handling the end-of-lines.
In fact, it's pretty amazing for me that this has worked correctly for you
for some files, and I can readily understand that it didn't for others.
I think you should really look for another solution than Notepad++ for
converting to Base64.
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
2
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
1
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would usegpg --enarmor
.certutil
generates-----BEGIN CERTIFICATE-----
which will prevent gpg from working.
– evpo
Nov 15 at 2:34
|
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Notepad++ is an editor for text files, which are files that end with special
binary characters that denote an end-of-line.
It will always think that your text-line is found between two end-of-line
characters, and will mostly ignore the end-of-line itself in its operations.
This has the potential to destroy the file when converting to Base64,
since Notepad++ will convert the text between the end-of-lines, but may
cause a problem with not correctly handling the end-of-lines.
In fact, it's pretty amazing for me that this has worked correctly for you
for some files, and I can readily understand that it didn't for others.
I think you should really look for another solution than Notepad++ for
converting to Base64.
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
2
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
1
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would usegpg --enarmor
.certutil
generates-----BEGIN CERTIFICATE-----
which will prevent gpg from working.
– evpo
Nov 15 at 2:34
|
show 4 more comments
up vote
1
down vote
accepted
Notepad++ is an editor for text files, which are files that end with special
binary characters that denote an end-of-line.
It will always think that your text-line is found between two end-of-line
characters, and will mostly ignore the end-of-line itself in its operations.
This has the potential to destroy the file when converting to Base64,
since Notepad++ will convert the text between the end-of-lines, but may
cause a problem with not correctly handling the end-of-lines.
In fact, it's pretty amazing for me that this has worked correctly for you
for some files, and I can readily understand that it didn't for others.
I think you should really look for another solution than Notepad++ for
converting to Base64.
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
2
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
1
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would usegpg --enarmor
.certutil
generates-----BEGIN CERTIFICATE-----
which will prevent gpg from working.
– evpo
Nov 15 at 2:34
|
show 4 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Notepad++ is an editor for text files, which are files that end with special
binary characters that denote an end-of-line.
It will always think that your text-line is found between two end-of-line
characters, and will mostly ignore the end-of-line itself in its operations.
This has the potential to destroy the file when converting to Base64,
since Notepad++ will convert the text between the end-of-lines, but may
cause a problem with not correctly handling the end-of-lines.
In fact, it's pretty amazing for me that this has worked correctly for you
for some files, and I can readily understand that it didn't for others.
I think you should really look for another solution than Notepad++ for
converting to Base64.
Notepad++ is an editor for text files, which are files that end with special
binary characters that denote an end-of-line.
It will always think that your text-line is found between two end-of-line
characters, and will mostly ignore the end-of-line itself in its operations.
This has the potential to destroy the file when converting to Base64,
since Notepad++ will convert the text between the end-of-lines, but may
cause a problem with not correctly handling the end-of-lines.
In fact, it's pretty amazing for me that this has worked correctly for you
for some files, and I can readily understand that it didn't for others.
I think you should really look for another solution than Notepad++ for
converting to Base64.
answered Nov 14 at 18:42
harrymc
248k10257545
248k10257545
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
2
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
1
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would usegpg --enarmor
.certutil
generates-----BEGIN CERTIFICATE-----
which will prevent gpg from working.
– evpo
Nov 15 at 2:34
|
show 4 more comments
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
2
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
1
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would usegpg --enarmor
.certutil
generates-----BEGIN CERTIFICATE-----
which will prevent gpg from working.
– evpo
Nov 15 at 2:34
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
After some more attempts I found something interesting. If I decrypt the Base64 encoded file, I get an error (i.imgur.com/jcD4n1b.jpg). BUT, If I copy the contents of the file directly into gpg4win's notepad, it works.
– get_going
Nov 14 at 19:34
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
You found a method of circumventing the end-of-line problem? I don't know gpg4win so cannot explain why it works.
– harrymc
Nov 14 at 20:26
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
No I didn't. I just described what I observed, i.e. if I open the Base64 encoded file and copy the contents to gpg4win's notepad, it can decrypt. So I know Notepad++ is doing something right. But if I ask gpg4win to decrypt the file itself, it fails. What reliable alternative you can recommend on Windows?
– get_going
Nov 14 at 20:30
2
2
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
Microsoft#s certutil can do that (and much more), see this answer for a description. There are many others floating around like this one.
– harrymc
Nov 14 at 20:39
1
1
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would use
gpg --enarmor
. certutil
generates -----BEGIN CERTIFICATE-----
which will prevent gpg from working.– evpo
Nov 15 at 2:34
I agree with this answer. Without thorough investigation, you could say that opening a binary file in a text editor and using a plug-in that expects ascii input is an unreliable solution. I would use
gpg --enarmor
. certutil
generates -----BEGIN CERTIFICATE-----
which will prevent gpg from working.– evpo
Nov 15 at 2:34
|
show 4 more comments
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375379%2fhow-to-convert-gpg4wins-binary-to-ascii-with-notepad%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
With this approach I think you are having difficulties with characters that Notepad++ understands as end-of-line. I don't think this is viable.
– harrymc
Nov 14 at 17:25
1
I don't have access to a windows environment so I can't test gpg4win or Notepad++. However, using gpg I have verified that 1) gpg ignores whitespace except that the
-----BEGIN PGP MESSAGE-----
must end in a newline and the-----END PGP MESSAGE-----
must be preceded by a newline. 2) You don't need a comment line, but if you do have one it must be terminated by a newline. 3) You don't need a checksum line, but if you have one it must be preceded by a newline and it must be the correct checksum.– James K Polk
Nov 14 at 21:01
@james-k-polk. Hi James, I could get certutil and even openssl to work (had to add the BEGIN/END lines manually), but Notepad++ doesn't work for encoding. It's works every time for decoding though.
– get_going
Nov 15 at 0:21