Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to compare 2 encrypted files? Post 302297679 by nsharath on Saturday 14th of March 2009 12:59:06 PM
Old 03-14-2009
Bug how to compare 2 encrypted files?

I have 2 files :-
1) f1.txt and f2.txt.Both contain some text as -
Quote:
123456

2)Now I did :
Quote:
[...]#cmp f1.txt f2.txt
(OR)
[...]#diff f1.txt f2.txt
output: I got them to be equal.
3) I encrypted them using gpg and with the SAME paraphrase :-
Quote:
gpg -c --cipher-algo aes256 f1.txt

gpg -c --cipher-algo aes256 f2.txt
4)Now I did :
[...]#cmp f1.txt.gpg f2.txt.gpg
(OR)
[...]#diff f1.txt.gpg f2.txt.gpg
[/QUOTE]
output: I got them to be NOT equal.

Can you please tell me why?
My actual intension is to know how to compare any 2 encrypted files to know whether they contain the same text or not without DECRYPTING them!!!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

executing encrypted files

Hi, Is there a way of executing encrypted files? I have encrpyted files using vi and crypt, but when I execute the encrypted file, it takes the contents literally (special characters, junk - encrpyted format). Kind Regards, Kawah (1 Reply)
Discussion started by: Kawah Cheung
1 Replies

2. UNIX for Advanced & Expert Users

executing encrypted files

Hi, Is there a way of executing encrypted files? I have encrpyted files using vi and crypt, but when I execute the encrypted file, it takes the contents literally (special characters, junk - encrpyted format). Kind Regards, Kawah (4 Replies)
Discussion started by: Kawah Cheung
4 Replies

3. UNIX for Dummies Questions & Answers

encrypted files

Hi lads me again trying to get a wee bit fancy with my scripting anyway it dosn't seem to want to run (strange as it may seem) I encrypted a file renamed it and wrote another file that unencrypts it (it contains passwords) (and b4 anyone says I am doing this for my own reasons) In a... (3 Replies)
Discussion started by: w33man
3 Replies

4. UNIX for Dummies Questions & Answers

How to unzip multiple files (encrypted) in a directory.

Good day all. I want to unzip multiple files in a directory. Suppose there are two files: test.txt.zip and test1.txt.zip Using this command: unzip -o -P test*.zip results in the unzipping of the first file not second. It gives this error: Archive: test.txt.zip caution: filename not... (2 Replies)
Discussion started by: er_ashu
2 Replies

5. Shell Programming and Scripting

compare files in two directories and output changed files to third directory

I have searched about 30 threads, a load of Google pages and cannot find what I am looking for. I have some of the parts but not the whole. I cannot seem to get the puzzle fit together. I have three folders, two of which contain different versions of multiple files, dist/file1.php dist/file2.php... (4 Replies)
Discussion started by: bkeep
4 Replies

6. Shell Programming and Scripting

How to compare 2 files & get only few columns based on a condition related to both files?

Hiiiii friends I have 2 files which contains huge data & few lines of it are as shown below File1: b.dat(which has 21 columns) SSR 1976 8 12 13 10 44.00 39.0700 70.7800 7.0 0 0.00 0 2.78 0.00 0.00 0 0.00 2.78 0 NULL ISC 1976 8 12 22 32 37.39 36.2942 70.7338... (6 Replies)
Discussion started by: reva
6 Replies

7. Linux

Secured encrypted files via Linux

I need to encrypt a ".txt" file with password settings and it should decrypt the file automatoically when end user types correct password. Can some one help me on this. Thank you (3 Replies)
Discussion started by: rlmadhav
3 Replies

8. Shell Programming and Scripting

Compare 2 folders to find several missing files among huge amounts of files.

Hi, all: I've got two folders, say, "folder1" and "folder2". Under each, there are thousands of files. It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command. However, if I change the above question a... (1 Reply)
Discussion started by: jiapei100
1 Replies

9. Shell Programming and Scripting

Require compare command to compare 4 files

I have four files, I need to compare these files together. As such i know "sdiff and comm" commands but these commands compare 2 files together. If I use sdiff command then i have to compare each file with other which will increase the codes. Please suggest if you know some commands whcih can... (6 Replies)
Discussion started by: nehashine
6 Replies

10. Shell Programming and Scripting

Compare multiple files, and extract items that are common to ALL files only

I have this code awk 'NR==FNR{a=$1;next} a' file1 file2 which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30) and the code will return only the items that are in every single one of those files and ignore the ones... (7 Replies)
Discussion started by: castrojc
7 Replies
PAPERKEY(1)						      General Commands Manual						       PAPERKEY(1)

NAME
paperkey - extract secret information out of OpenPGP secret keys SYNOPSIS
paperkey [--secret-key=FILE] [--output=FILE] [--output-type=base16|raw] [--output-width=WIDTH] paperkey --pubring=FILE [--secrets=FILE] [--input-type=auto|base16|raw] [--output=FILE] [--ignore-crc-error] [--comment=STRING] [--file-format] paperkey --version MOTIVATION
As with all data, secret keys should be backed up. In fact, secret keys should be backed up even better than other data, because they are impossible to recreate should they ever be lost. All files encrypted to lost keys are forever (or at least for a long time) undecipher- able. In addition to keeping backups of secret key information on digital media such as USB-sticks or CDs it is reasonable to keep an if- all-else-fails copy on plain old paper, for use should your digital media ever become unreadable for whatever reason. Stored properly, paper is able to keep information for several decades or longer. With GnuPG, PGP, or other OpenPGP implementations the secret key usually contains a lot more than just the secret numbers that are impor- tant. They also hold all the public values of key pairs, user ids, expiration times and more. In order to minimize the information that has to be entered manually or with the help of OCR software, paperkey extracts just the secret information out of OpenPGP secret keys. For recovering a secret key it is assumed that the public key is still available, for instance from public internet keyservers. DESCRIPTION
paperkey has two modes of operation: The first mode creates "paperkeys" by extracting just the secret information from a secret key, formatting the data in a way suitable for printing or in a raw mode for further processing. The other mode rebuilds secret keys from such a paperkey and a copy of the public key, also verifying the checksums embedded in the paperkey. This mode is selected when the --pubring option is used, which is required in that case. If a passphrase was set on the origi- nal secret key, the same passphrase is set on the rebuilt key. Input is read from standard-in except when the --secret-key or --secrets option is used; output is printed to standard-out, unless changed with the --output option. SECURITY CONSIDERATIONS
Please note that paperkey does not change the protection and encryption status of and security requirements for storing your secret key. If the secret key was protected by a passphrase so is the paperkey. If the secret key was unprotected the paperkey will not be protected either. OPTIONS
--help, -h Display a short help message and exit successfully. --version, -V Print version information and copyright information and exit successfully. --verbose, -v Print status and progress information to standard-error while processing the input. Repeat for even more output. --output=FILE, -o Redirect output to the file given instead of printing to standard-output. --comment=STRING Include the specified comment in the base16 output. --file-format Paperkey automatically includes the file format it uses as comments at the top of the base16 output. This command simply prints out the file format and exits successfully. OPTIONS FOR EXTRACTING SECRET INFORMATION
--output-type=base16, --output-type=raw Select the output type. The base16 style encodes the information in the style of a classic hex-dump, including line numbers and per-line CRC checksums to facilitate localizing errors in the input file during the recovery phase. The raw, or binary, mode is just a raw dump of the secret information, intended for feeding to barcode generators or the like. --output-width=WIDTH Choose line width in the base16 output mode. The default is 78 characters. --secret-key=FILE File to read the secret key from. If this option is not given paperkey reads from standard-input. OPTIONS FOR RE-CREATING PRIVATE KEYS --input-type=auto, --input-type=base16, --input-type=raw Specify that the given input is either in base16 format, as produced by paperkey, or in raw format. The default, auto, tries to automatically detect the format in use. --pubring=FILE File to read public key information from. It is assumed that the user can get the public key from sources like public internet key- servers. --secrets=FILE File to read the extracted secrets, the paperkey, from. If this is not given then the information is read from standard-input. --ignore-crc-error Do not reject corrupt input and continue despite any CRC errors. EXAMPLES
Take the secret key in key.gpg and generate a text file to-be-printed.txt that contains the secret data: $ paperkey --secret-key my-secret-key.gpg --output to-be-printed.txt Take the secret key data in my-key-text-file.txt and combine it with my-public-key.gpg to reconstruct my-secret-key.gpg: $ paperkey --pubring my-public-key.gpg --secrets my-key-text-file.txt --output my-secret-key.gpg If --output is not specified, the output goes to stdout. If --secret-key is not specified, the data is read from stdin so you can do things like: $ gpg --export-secret-key my-key | paperkey | lpr SEE ALSO
gpg(1), http://www.jabberwocky.com/software/paperkey/ AUTHORS
paperkey is written by David Shaw <dshaw@jabberwocky.com>. PAPERKEY
January 2008 PAPERKEY(1)
All times are GMT -4. The time now is 03:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy