LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   whats the point in Xor encryption ? (https://www.linuxquestions.org/questions/linux-security-4/whats-the-point-in-xor-encryption-142191/)

qwijibow 02-04-2004 09:43 AM

whats the point in Xor encryption ?
 
Ive been fiddleing around with Xor encryption basically because its the only
form on encryption available to all Unix like systems by default.

But whats the point in Xor encryption in computers anyway.
losetup (a loopback driver for file systems) has xor encryption built into it.

BUT...

have a look at the following possible encryption.

Password = 01101001
Data = 00000000
Encrypted Data = 01101001

which makes it insanely easy to break this encryption.

i encrypted a floppy as follows.

cat /dev/urandom > /dev/fd0 (write random data firectly to disk (no file system)
losetup -e xor /dev/loop1 /dev/fd0 (stick assign encrypted loop to flopy disk)
[password]
mkfs.vfat /dev/loop1 ( write a Fat32 file system to the encryption loop )
losetup -d /dev/loop1

tadaaa, the disk is now encrypted, you could mount it, and use it as a floppy by recreating the loop, and mouning the loop on the file tree sumwhere.

HOWEVER, anywhere there is a groupe of encrypted Zero's on the disk ( executable files are FULL of zero's also so is the FAT ) you will see a the password .

in other works, encrypt the data 00000000 with passowrd Bumfluf gives encrypted data = Bumfluf !!!

use a program like cat to directly read raw data off the disk

cat /dev/fd0 | less

and BOOM,,, everywhere u look, the screen is filled with the password written over and over and over. you cant miss it !

i know they consider Xor to be weak encryption... but this is just stupid !!

luckily im using aes256 on ym home directory ;)

snacky 02-04-2004 09:53 AM

Just in case this isn't a troll:

Google "one-time pads." Grok in fullness.

qwijibow 02-04-2004 10:51 AM

its not a troll...
i asked a question. what makes you think im trolling.
and i think its a very good question.

whats the point ?
if anything, all this does is slow down ur system, and make less experianced people thinlk there documents are safe, when inface any idiot could get them in a matter of seconds.

whats the point in adding utilities that allow you to encrypt a disk, but at the same
time, paste the decryption code all over the disk for any idiot to see ?

some1 must have programmed this feature, Why ?
and som1 must have made the decision to include it in linux distributions ?

why did they bother ?
this adds no security, just slows down the system slightly.

and i searched google for one time pads....

yes i know there are other types of encryption out there.

but im talking about Xor encryption.

follow the steps i posted if u dont beleive,
but xor encryption is very easily breakable.

qwijibow 02-04-2004 10:57 AM

Ahhhh.. upon reading further into your one time pads i discover a mojor flaw.

the encryption Key must be equal in length to the Data it is encrypting.
So... en ncrypt my 6 gig hard disk, i could only have 3 gigs of data and 3 gig key....

hmm.

also, i think you will find that the password limit on xor encryption is 32 characters.

my question still stands
?

stickman 02-04-2004 11:08 AM

Quote:

Originally posted by qwijibow
why did they bother ?
this adds no security, just slows down the system slightly.

XOR encryption is designed to add a quick encryption layer to protect data from a casual observer. As far as the key and data being equal in length, if you have 6GB of data, you could use a 256bit key and encrypt all of the data by encrypting sequential 256bit blocks one at a time until you reach the end.

qwijibow 02-04-2004 11:11 AM

Quote:

256bit key and encrypt all of the data by encrypting it 256bit at a time until you reach the end.
yeah but that would be breakable.

okay, so its portection againsed people who dont know how to use computers.
if sumthings worth encrypting, its worth encrypting properly. ill stick with my aes256 ;)

snacky 02-04-2004 11:16 AM

I've probably just spent way too much time reading slashdot, but when I read your post, it struck me as something a person might write to screw with other peoples' heads :)

A one-time pad is the only proven 100% secure form of encryption in existence.

However, it has two very important limitations. One is, like you found out, the key has to be as long as the plaintext. Two - and this is actually the same thing if you think about it - the pad can't be used more than once.

An encrypted file system approach is meant to be used with a symmetric key cipher like AES, 3DES, Twofish, etc. There are practical uses for one-time pads but encrypting an entire hard disk isn't one of them for most people...

wapcaplet 02-04-2004 11:25 AM

Quote:

Originally posted by snacky
A one-time pad is the only proven 100% secure form of encryption in existence.
Only if it is 100% guaranteed to be truly random, and there is precisely 0% chance of your key being stolen. I guess true randomness is possible, but there is always the question of how to get the key to the parties that need to decrypt, so it's always a possibility that the key will be stolen. Nothing is 100% secure :)

stickman 02-04-2004 11:33 AM

Quote:

Originally posted by qwijibow
yeah but that would be breakable.
Yes, XOR is pretty weak, but that doesn't mean that it's worthless either. As snacky pointed out, it's good for one time pads. By the time someone does the decryption, it's no longer valid.

snacky 02-04-2004 11:33 AM

Quote:

Only if it is 100% guaranteed to be truly random, and there is precisely 0% chance of your key being stolen.
ALL cryptosystems require these assumptions to hold true in order to have any kind of security, though. The difference is that it hasn't been absolutely proven that any of the secret-key algorithms don't have some kind of funny trick that can sometimes or often reduce key strength to something way below 2^n (where n is keylength). We also know for a fact that factoring primes is sub-exponential and it hasn't been proven that there isn't some blazingly fast way to do it. (this means RSA just might become worthless some day.)

There are no such doubts about one-time pads. They're different from everything else this way.

qwijibow 02-04-2004 11:51 AM

But im talking about the Xor capabilitys of linux to use disk encryption.
you can break the encryption in under a minute, even with the maximum allowd password of 32 characters.

not one time pads.

ream man losetup

wapcaplet 02-04-2004 12:48 PM

Quote:

Originally posted by snacky
ALL cryptosystems require these assumptions to hold true in order to have any kind of security, though. The difference is that it hasn't been absolutely proven that any of the secret-key algorithms don't have some kind of funny trick that can sometimes or often reduce key strength to something way below 2^n (where n is keylength). We also know for a fact that factoring primes is sub-exponential and it hasn't been proven that there isn't some blazingly fast way to do it. (this means RSA just might become worthless some day.)

There are no such doubts about one-time pads. They're different from everything else this way.

Good point. And yeah, most of our crypto algorithms now depend on difficulty and computational feasibility of one kind or another; they've built quantum computers with 7 qubits, so RSA is safe for now, but if some kind of breakthrough occurs in that field, we may have to take a different approach.

qwijibow 02-04-2004 04:33 PM

7 qubits puts the most powerfull quantim computer as powerfull as your average pocket calculator. so there's no threat froom quantum processors just yet ;)

wapcaplet 02-04-2004 05:24 PM

Quote:

Originally posted by qwijibow
7 qubits puts the most powerfull quantim computer as powerfull as your average pocket calculator. so there's no threat froom quantum processors just yet ;)
Well, it's a hard comparison to make though. A 7-qubit quantum computer can effectively do 2^7 calculations with a single operation; a non-quantum computer has to do all 2^7 calculations individually. It's a whole different kind of computing.

qwijibow 02-05-2004 07:01 AM

True....
But how many simultaniouse calculations per second does it do ?

it no good doing 100,000 operations simultainiously if if it only does one set of simultainiouse operatings a second.

also, there will be times when so many operations cannot be done untill the result of anouther is calculatted, so on some loops, not all possible calculations will be useful.

anyway....

for the moment, i wouldnt worry too much about them.

wapcaplet 02-05-2004 08:35 AM

I think you misunderstand the idea behind quantum computing; as mentioned, a 7-qubit quantum computer can effectively do 2^7 calculations with *one* calculation. If you had a 64-qubit quantum computer, you could do 2^64 calculations with *one* calculation. Quantum bits can be in a superposition of states - they can be both zero and one at the same time. The single calculation causes the quantum bits to "choose" zero or one, so in a way that single calculation can give you an answer that a normal computer would have to brute-force its way through all 2^64 permutations to get.

Just to give you an idea how long it would take a standard computer to brute-force through 2^64 permutations, consider that it took Distributed.net 1700 days to find the answer to one 64-bit key. With classical computing, if you add another bit, it doubles the amount of time required to brute-force an answer; with a quantum computer, you just need to find a way to add one more qubit.

As for waiting on previous calculations, that may be an issue, but the general idea is that a quantum computer does all of the calculations at once.

And no, I wouldn't worry about them just yet, but they definitely have potential.

qwijibow 02-05-2004 07:29 PM

ahh okay.
ive done a little physics, and i understand the idea's on super position.
i think the 1's and zero's are coded into spinning qbits, clockwise is one bit, anti-clickwise the other ???

but as far as my understanding goes, a 3 abit computer could be in (2^3) + 1=9 states at once.

000
001
010
.......
111

but i wasnt told about how that would be put to use.
but what you say makes sence.

i was surprised at how far quantum computers have come,
did you know you can download programming languages for them.
cant remember any URL's though.

qwijibow 02-05-2004 07:33 PM

Ohhh,, and i read a New Scientist Article on quantum cryptogrophy.
i hear quantum cryptogrophy (using somthing to do with the particle wave duality of photons) was meant to be as touch to brute force to a quantum computer, as regular encryption is to a regular computer.

but anyway, i think ive drifted far enough from the topic, hehe.

wapcaplet 02-05-2004 07:56 PM

Quote:

Originally posted by qwijibow
but anyway, i think ive drifted far enough from the topic, hehe.
You and me both :)

I had a university course that covered the subject a bit (no pun intended). Yeah, the bits can be encoded as spin or any other state that a quantum particle can be in. I'm not sure about how quantum cryptography would work; since you can only do the operation on a set of qubits once, I think it makes them fairly tamper-proof, since if someone tries to decrypt your message, it'll garble the message. Not sure about that though. Quantum computers could definitely change a lot of things though!

iainr 02-06-2004 07:11 AM

Quote:

Originally posted by wapcaplet
I think it makes them fairly tamper-proof, since if someone tries to decrypt your message, it'll garble the message.
This is the bit I've never understood. Surely, this makes it tamper evident, not tamper proof (someone can still mess with the message, but you'll know they've done it).

That opens up an obvious line of attack against quantum cryptography : all Eve has to do is to try to read every message. That will garble them up, forcing Alice and Bob to use a less secure communication method.

wapcaplet 02-06-2004 09:29 AM

Quote:

Originally posted by iainr
This is the bit I've never understood. Surely, this makes it tamper evident, not tamper proof (someone can still mess with the message, but you'll know they've done it)
Yeah, that's what I meant :)

As for the garble-every-message attack... I'm not sure how to get around that. One thing we talked about in my course was using a pair of entangled particles to send a message without actually transmitting anything: Alice and Bob each have an entangled particle. When Alice does something to the particle, it affects Bob's particle too. That may be applicable to the situation; I dunno. I know very little about quantum physics.

SciYro 02-06-2004 10:15 AM

iv done some reashear on quontoms psysics in teh past, from what i heard the quantom code is basicaly a particale taht is split into 2 particles , teh sientsts had each on do in oposite directions untill tehy wre 6 miles apart, whatever happened to 1 particle happened to teh other, only 1 problem they had, when the 1rst particle as played with in some way, the 2nd particle would react instananisouly , the scientsts 6 miles away at the2nd particle coulnt find out what has hapening to the first untill they were given a hint kinda,

so its more like tranmiting half a message in relguar manner, and the other half across a whatever (sence it happens faster then lite when 1 particle is played the other particle reacts, ill call whatever its sent across, whatever :))

wapcaplet 02-06-2004 10:19 AM

Quote:

Originally posted by SciYro
its more like tranmiting half a message in relguar manner, and the other half across a whatever (sence it happens fater then lite when 1 particle is played the other particle reacts, ill call whatever its sent across, whatever :))
Yeah... I think the example we talked about was how to send two bits of information by only transmitting one actual bit. Alice does something to her particle, transmits 1 bit to Bob, then Bob does something to his particle and gains the second bit of information.

Complicated. I'm glad I didn't go into quantum physics, or I'd be totally lost :)

SciYro 02-06-2004 11:05 AM

lol its fun, only im to young to be in collage so i have to learn off the internet (like anyhting else thats important to me that i want to learn), but if ya realy wanna get confused, what if the "2 particles" were actualy only 1?, neways, to get outa topic for a sec, i wonder if it would be possbile one day that the internet was sent thru split particles, so you could have FAST internet, lol

, btw does anyone know what particle they prefer to use in trying to make quantom computers?

iainr 02-07-2004 03:10 PM

Quote:

Originally posted by SciYro
from what i heard the quantom code is basicaly a particale taht is split into 2 particles , teh sientsts had each on do in oposite directions untill tehy wre 6 miles apart, whatever happened to 1 particle happened to teh other, only 1 problem they had, when the 1rst particle as played with in some way, the 2nd particle would react instananisouly , the scientsts 6 miles away at the2nd particle coulnt find out what has hapening to the first untill they were given a hint kinda
I guess this might work in theory, but I don't think it would be a very practicle implementation of quantum cryptography. All the particles have to start off together (to become entangled) before being separated; and the quantum states can't change before you want them to.

I guess the mechanism wouldn't work so well if someone had to come round every few hours to pick up more entangled particles. You might as well just tell that person the message directly really.

SciYro 02-08-2004 08:07 AM

the point of it is that its impossible for anyone to intercept the comuniacation using the 2 particles becuase whatever happens hapens much faster then light, but i dont think that u need new particles every few hours, but it is realy a intresitng thing to know, in teh future it will probly get better (or mybe somone will invent a way to travel across space imstantly (hey, if particles can do it, y cant we?)

wapcaplet 02-08-2004 02:37 PM

They've already managed to teleport a laser beam, so it may be possible one day :)


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