LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-17-2009, 08:07 PM   #1
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Rep: Reputation: 57
Can encryption beat a man-in-the-middle attack?


If I could get physical access to a server and store a few GB of really random text on the server, or somehow store it when there is NO man in the middle, I could then program a special proxy in the server whereby the link between me and the proxy would be encrypted with the one-time pad method, ie by simply XORing the random text with the data.

Then it is impossible to break the encryption, but it is also impossible for the man in the middle to harm me by directing me to another server of theirs, because that other server does not have a copy of the secret random text.

1. Can the same be achieved by conventional encryption schemes like SSL or PGP when I do NOT have physical access to a proxy?

2. Can a conventional authentication take place somewhere where there is no man in the middle, at a cafe or something, and then continue my access at a place where I know there is a man in the middle to any access to the internet?
 
Old 11-17-2009, 08:23 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'd suggest a Google search for one time passwords (OTP). Also read RFC 2222. Look up OPIE (One Time Passwords in Everything) and the pam_opie module.

SSH and others are susceptible to man-in-the-middle attack during the initial connection. Certificates were supposed to take care of that possibility. If you do have physical access to the server and can save your public key on it, and grab it's public key, then AFAIK, you won't be susceptible.

You don't seem to be separating authentication and encryption at all in your scheme. The encryption would be unbreakable as long as you never reused the key. If an attacker has two encoded messages using the same key, guessing the contents of one message, xor'ing the guess and applying it to the second message would be trivial. Also consider that "really random text" isn't easy. Also you would need several GB of keys for each server and you would need to keep them straight.

The US used one time pads for communications with submarines in WW1. They carried in several suitcases of keys when they make port. On of the axis powers found out about this and adopted OTP themselves, however they didn't know that you should never ever reuse the keys. Their codes were broken. OTP allows one-to-one communication, but what about server A talking to server B?

Last edited by jschiwal; 11-17-2009 at 08:41 PM.
 
Old 11-17-2009, 09:42 PM   #3
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Thanks. By the way, I am aware of the one-time requirement, I think it was mentioned.

Given that physical access is not really an option, what if I can assume that there is no MITM in one session, and use that session to save my public key on the proxy, and grab its public key as you are saying (how do I do this?). Then how do I tell my browser in another session to connect to that proxy according to the keys?

Last edited by Ulysses_; 11-17-2009 at 09:46 PM.
 
Old 11-18-2009, 12:44 AM   #4
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
why dont you set up apache with ssl and make a server cert and a client soft cert and then make the website require the client cert. If there is a client cert you cant man-in-the-middle the connection because the middle man does not have 2 certs that would be required.

Last edited by slimm609; 11-18-2009 at 06:22 AM.
 
Old 11-22-2009, 03:30 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,599
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
The supposed "security" of a one-time pad is actually quite specious: the communications are actually no more, and no less, secure than the key itself. Realistically speaking, if you could possibly attain the necessary degree of protection for the key, you would have no need for encryption at all: if you can protect the key to that degree, then it follows that you'd also be able to protect the plaintext just as thoroughly, so why bother to encrypt it?

Furthermore, if someone did duplicate the "secret" key, and used it to encrypt bogus messages, you would have absolutely no way to know that the messages were not authentic. And if you somehow discovered the theft, well, you'd still be screwed: you'd have no way to repudiate the stolen key!

The weakness of the "impregnable" one-time key system is that the "secret" key must in fact be disclosed, in its entirety and in unprotected form, to every user of the crypto system!

A well-managed certificate based system has none of these deficiencies, because two people can securely communicate with one another (and only with one another) without either one of them having to reveal their personal secret. There are very sound reasons why these principles are used, even for high-grade military communications.

Last edited by sundialsvcs; 11-22-2009 at 03:32 PM.
 
Old 11-22-2009, 03:49 PM   #6
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by sundialsvcs View Post
if you can protect the key to that degree, then it follows that you'd also be able to protect the plaintext just as thoroughly, so why bother to encrypt it?
If it were one message being transmitted and no more, I'd use snail mail rather than send DVDs or physically access the server. What is required here is a secure proxy service for long term use, that can beat a MITM attack.

Btw, the suggestion of the one-time-pad was for a proxy of my own, not for a proxy shared with millions. The key is only held in my computer and the server. It does not ever appear in a wire, it is physically sent in a DVD. So the man in the middle has no chance. Only by breaking into the server. Or my computer.

Last edited by Ulysses_; 11-22-2009 at 04:07 PM.
 
Old 11-23-2009, 05:07 AM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
The suggest several things here:
http://en.wikipedia.org/wiki/Man_in_the_middle_attack

I don't think that encryption in and of itself can never beat the man in the middle attack. It's the authentication that is the issue.

I think they released a fix for SSL, and others:
http://blog.g-sec.lu/2009/11/sslv3-t...erability.html
 
  


Reply


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
"Man in the middle attack" works against mix network? How to prevent? argh2xxx Linux - Security 6 09-28-2008 03:39 AM
ssh man-in-the-middle naomi Linux - Security 2 05-19-2005 02:04 PM
man in the middle attack atul_mehrotra Programming 12 09-22-2004 11:48 AM
man in the middle attack atul_mehrotra Linux - Security 4 09-22-2004 09:02 AM
Man in the middle attack juanb Linux - Security 17 03-29-2004 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:17 PM.

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