LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-24-2012, 05:09 AM   #1
tangle
Senior Member
 
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761

Rep: Reputation: 78
File Encryption Test


I have written a program to encrypt a file using AES encryiption in Python using PyCrypto. Is there a way to test the encryption? I would like to be sure that it is working the way it should. Thanks
 
Old 07-24-2012, 05:18 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
depends what you mean by "test" really.. encrypt something manually and also with your script and compare them?
 
Old 07-24-2012, 12:49 PM   #3
tangle
Senior Member
 
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761

Original Poster
Rep: Reputation: 78
I want to test to see if it can be easily broken.
 
Old 07-24-2012, 02:56 PM   #4
NyteOwl
Member
 
Registered: Aug 2008
Location: Nova Scotia, Canada
Distribution: Slackware, OpenBSD, others periodically
Posts: 512

Rep: Reputation: 139Reputation: 139
T make sure the file was encrypted properly, encrypt it with your program and try decrypting it with someone elses. Unless you are using some special file format (or the other program is) it should decrypt properly.

If the encryption engine is impelemented properly the answer is no. The algorithm is fine for all normal use but if implemented incorrectly may be open to attack.
 
Old 07-25-2012, 02:01 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You have two parts, 1) the file IS AES encrypted or not. That's trivial to verift by decrypting it again legimately but 2) AES IS AES. Your AES encrypted file can't be any less well encrypted than anyone elses, so just read up on it - http://en.wikipedia.org/wiki/Advance...ption_Standard
 
Old 07-25-2012, 04:37 AM   #6
tangle
Senior Member
 
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761

Original Poster
Rep: Reputation: 78
Thanks
 
Old 07-30-2012, 02:15 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
To put it another way, the AES block cipher you're using is not going to be the "weak link" in the chain that comprises your delivered application.

Software encryption is apparently quite difficult to implement properly, though. There are a lot of places for keys or sensitive data to unknowlingly (to you) end up on a complex OS, including temporary files (even unlinked ones), swap space, and RAM.

To speak to your questions / points:
Quote:
Originally Posted by tangle
I have written a program to encrypt a file using AES encryiption in Python using PyCrypto. Is there a way to test the encryption? I would like to be sure that it is working the way it should.
As mentioned by the other folks, if symmetric key + cipher can successfully decrypt ciphertext, then you've confirmed symmetric key + cipher were used to encrypt the plaintext.

Quote:
Originally Posted by tangle
I want to test to see if it can be easily broken.
Totally depends on context. The way you've implemented the encryption, and the way any third-party modules you're using have implemented the encryption, will determine whether it can be easily broken. (But, again, it's not going to be easily broken by someone performing a cryptanalysis on AES any time soon. Not when there is much lower hanging fruit.)

If you need substantial advice and direction on this topic, then I recommend both of:
  • Cryptography Engineering by Schneier and Kohno
  • Applied Cryptography by Schneier

There's not an easy answer. Deep, fundamental understanding will aid you in developing "good" software encryption.
 
  


Reply



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
Load test, boundary test & stress test for USB EHCI/xHCI driver rama_toshiba Linux - Kernel 5 02-29-2012 02:43 PM
LXer: The best file encryption software in open source – group test LXer Syndicated Linux News 0 08-08-2011 01:00 PM
vpn encryption test saavik Linux - Networking 3 05-14-2009 08:52 AM
Test failed on encryption for aes-asm jordanwb Linux - General 7 02-09-2009 01:18 PM
rpmbuild error: File ./test-2.3.0/SOURCES/test-2.3.0.tar.gz: No such file powah Linux - Software 1 12-13-2007 03:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:56 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