LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-06-2009, 07:46 AM   #1
amquiapo
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Rep: Reputation: 0
Question GPG PROBLEM: some characters textfile that was decryrted were altered


Hi,

I'm Having problem with gpg decrypted file. I can successfully encrypt file in Linux and try to decrypt in in a windows workstation. Here is the thing when i try to open the decrypt file in notepad the "next line (enter)" was change to a "box character" and the messages was read as a one linner, i already tried openning it using Word and it looks fine, but the problem is i need to open it in notepad because "the process should be like that". I also tried signing the encrypt file logically the file was not altered since the sign is the same but the box character are still appeared, also tried to tar first the file before encryption again same thing happen.Is there a way so the box character wont change the "nextline"? Hope you can help me in this one
 
Old 01-07-2009, 09:47 AM   #2
malwodyn
LQ Newbie
 
Registered: Dec 2008
Location: South Wales, UK
Distribution: Ubuntu 12.10; have used Fedora in the past
Posts: 28

Rep: Reputation: 0
I'm very much a Linux Newbie, but I suspect that the "box" characters you are seeing displayed on the screen are characters that your version of Window$ will not allow to be displayed, or is unable to display. They could be characters in the extended ASCII character set (such as e-acute - é), or perhaps the matter is more serious and the file is somehow being corrupted. Have you tried to compare the original unencrypted text with the decrypted text? Remember that Micro$oft Internet Explorer has a mind of its own - I ran a spelling check on this posting, and it wanted to change Newbie and é (though left Micro$oft alone.....)
 
Old 01-07-2009, 06:18 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Well, Linux (& Unix) use \n as a newline char, MSDOS (WIN) uses \r\n. It may be that Word can cope, but Notepad can't.
I can't test that as I don't have MS at home.
You can try using /usr/bin/unix2dos to convert before encryption.
 
Old 01-08-2009, 06:00 AM   #4
amquiapo
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Original Poster
Rep: Reputation: 0
thanks but i already found a solution in this matter, turns out gpg has the option were you can specify that the file is a textfile i include the -t or -textmode in the gpg command just like below

gpg --output /root/quia_praktis/EM11081118.txt.gpg -cts EM11081118.txt


then after the i transfered the gpg file from linux to windows and decrypt it, i got the same data without any alteration. In the mannual for gpg it explains that -t or -textmode "Treat input files as text and store them in the OpenPGP canonical text form with standard "CRLF" line endings. This also sets the necessary flags to inform the recipient that the encrypted or signed data is text and may need its line endings converted back to whatever the local system uses. This option is use-ful when communicating between two platforms that have different line ending conventions (UNIX-like to Mac, Mac to Windows, etc)."


thanks=D...
 
  


Reply

Tags
gpg


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 10:06 AM
c++ - parsing windows textfile: how to strip extra characters? babag Programming 4 05-19-2008 07:57 PM
search unknown special characters on a textfile bad_jaye Linux - Newbie 6 05-02-2008 09:55 PM
use apt-get to check for altered files? leapy Linux - Security 4 08-05-2007 05:41 PM
anyone have an un-altered smb.conf file? Zaius Linux - Newbie 3 01-13-2004 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration