View Full Version : Algorithmic Encryptions
01-31-02, 08:02 AM
I am a complete and utter none starter on this subject but would like to ask a question about algorithmic encryptions - its hard enough to spell!
What exactly does an algorithmic encrypter do?
The reason I ask is that one contacted me last year, asking if he could put a reference to a page in my domain on the Enigma Code Machine in his Help Files for Microsoft Algorithmic Engineering students to be able to cross reference with. Please don't baffle me with science - I really know nothing about this subject apart from the fact that it is encryption devices/software helps to keep my pc free from prying eyes; mine being the 128 bit encryption!:rolleyes:
When I was in primary school, algorithm meant a series of steps on a number line, for example: start at zero, forward three, back seven, forward two, back five, and repeat, which would give you a series of numbers for a code, which could only be unlocked by knowing the key used to reach them.
Now, (maybe for ever, as far as I know) it is used to describe any sequence of steps. Of course in programming it isn't as strictly mathematical, so the term is used this way here. To describe any series of steps which must be taken to achieve a result. You may or may not know programming, but an example of an algorithm might be pass in a number, store it in a variable called largest, pass another number, compare it to largest and if it's bigger, then store than number in largest, then pass in another number, et cetera. That is a basic algorithm. Also one of the most commonly used.
An encryption algorithm is used almost exactly as the number line example. Words, syllables, and characters are replaced with other things depending on a sequence generated by the programme. The key for reading that sequence is used to open it up again. Sometimes it takes a combination of two keys, one held by the encrypter, one held by the decrypter.
The word algorithm, I think comes from an Arabian mathematician of the ninth century.
Enigma was goovy because it had so many options, something like 11 million per key or something crazy like that I think. However, it wasn't that great. The British were cracking it at Brecksley Park (can't recall the anme exactly, but it was something like that) from about 1938-39, using plain old brain power. Around 1942 they got the Colossus computer, which cut the cracking time from three weeks down to about three hours. Then of course a few enigma machines were captured, which also helped. A book recently published, and advertised in New Scientist magazine, claims several other powers were breaking the enigma codes prior to WW2.
Sorry if this is rambling a bit, I'm asleep on my chair. I'm gonna go to bed...
01-31-02, 12:04 PM
In 1929 a man called Schmidt tried to sell Enigma to the British and Americans, as well as the French - no takers! So he gave it to the Poles; who used it to great effect; even warning the "Allies" that Germany was about to come en masse over its borders. Bletchley Park was set up in WW2 as the Code Breaking Centre; with a mathematical genius at its helm, Alan Turing. He later devised the worlds first computer Colossus. At first, code breaking took weeks rather than days or hours until The British got hold of an enigma machine from a German trawler masquerading as a Danish trawler. The story of how the British got the machine is bravery itself with a sailor nearly drowning rather than give up the anonymous sack he was holding, rescued from the deep! The following is reprinted from my own page on Enigma.
At 1030 hrs on April 30th 1940, the Destroyer HMS Griffin was patrolling off Norway when a lookout spotted a vessel that seemed at first sight to be a Dutch trawler. The craft might not have attracted a second glance had it not been that John Lee-Barber, Griffin's Commander, had received a radio signal that another British warship in the vicinity had been attacked by a German armed trawler, posing as a Dutch fishing vessel, which led him to suspect that the ship in his gun sights might not be what it seemed. Lee-Barber signaled the ship to heave-to. Then, ignoring the very rough seas, he asked Alec Dennis, his First Lieutenant, to lead a boarding party to check it out. From a distance the vessel, which had the name Polares painted on its bow, looked like any other neutral trawler, and it was flying the Dutch flag.
But as Alex Dennis and his boarding party rowed closer in their whaler, he saw something that made his blood freeze. He had caught sight of a deck gun "dressed up" with a canvas cover so that it looked like a rowing boat. The large number of men milling around on the deck made Dennis feel only more uneasy. His suspicions were quickly confirmed when he jumped from his whaler onto the trawler deck. He was greeted by a bemused sailor who blurted out "German Ship" in a guttural German accent. As Dennis looked around he observed two torpedo tubes concealed under fishing nets, that could have inflicted serious damage on the Griffin had the destroyer attempted to approach the trawler. Dennis eventually established that the ship was the German Schiff 26, a trawler commandeered by the German Navy that had been on the way to Narvik to deliver ammunition, guns and mines to the occupying German army.
As other members of Dennis's boarding party leapt aboard, one of them let off his pistol by mistake, which startled him but served the purpose of terrifying the Germans. After that they queued up obediently on the deck so that they could be taken back to the Griffin as prisoners. Meanwhile another drama was being played out in the sea on the opposite side of the Polares. The German crew had thrown two huge bags of confidential documents and cipher apparatus into the water. One bag sank immediately but the other floated tantalisingly on the surface until Griffin's gunner, Florrie Foord, dived into the water in a last minute attempt to recover it. He caught hold of the bag but the line to which he was attached broke while he was being hauled on board, and he fell back into the rough sea. For one ghastly moment it seemed that nobody on Griffin would ever see either Foord or the bag again, but he appeared once more, still gallantly clutching the bag, and gratefully grasped a second line that was thrown to him.
Once again his one handed grip was not strong enough, and he disappeared under the water before bobbing up yet again. When the line was thrown to him a third time, he managed to secure a makeshift lasso over his shoulders and was hauled up, frozen, with the all important bag. Whilst Foord was drying himself, Dennis and his men made preparations to sail Polares to Scapa Flow, the British Naval base in the Orkneys. What happened there was to horrify John Godfrey, the Head of Naval Intelligence. The trawler should have been met by an alert reception committee and placed in a quiet corner, well out of the way of prying eyes, so that the documents on board could be inspected in secret. Instead it sailed into the centre of Scapa Flow - with the Swastika that Dennis and his men had raised provocatively overhead, and swept past the fleets flagship. Security was so lax that nobody stopped a Universal film crew filming the event. Fortunately the film was confiscated before it could be shown.
Looting was allowed after the boarding party had departed but before Naval Intelligence was able to inspect what was left on the ship, Intelligence Officers found the deck littered with papers, among them Enigma cipher documents and pages from a cipher pad. These documents, and those recovered from the water by Foord in the freezing waters off Norway, were to enable the naval enigma code to be broken, on May 11 1940, for the first time in the war. The signal pad pages with plain text German and the matching cipher text on them were all that was needed for the "bombe" machines invented by Alan Turing, the Bletchley Park code breaker, to work out how the Enigma had been set on the day it was captured. Once that had been established, the code could be broken for that day; if the scrambling elements inside Enigma, the three rotors and the plug board, could be set in exactly the same position as that set by the sender when enciphering his messages, the code breaker merely had to tap out the cipher text on the Enigma keyboard and the letters constituting the German plain text message would light up the Enigma lamp board.
However, the documents recovered provided the key for only 5 days, Apr 22 - 27 1940. The Enigma settings were changed each day, and Bletchley Park still had to find a way of working out the settings for days when there were no captured clues. Another document from the Polares was to be of much greater significance, for it laid out the procedure used by senders of messages to indicate to legitimate receivers how to set the scrambling elements in their Enigma machines so that the receivers could unbutton the messages they received. Knowledge of this "indicating procedure" enabled Alan Turing to devise another ingenious, though long winded, method of breaking the naval enigma code. This method was known as banburismus. However, it could be used in practice only if he had access to so called "bigram tables" which, in the course of the indicating procedure, were used to convert pairs of letters of the alphabet selected by the message sender into other pairs. Unfortunately, the bigram tables were not included in the sheaves of paper discovered on the Polares. Bletchley Park's code breakers had to wait almost a year before the seizing of more Enigma codebooks enabled them to make the next breakthrough. In March 1941 another trawler, Krebs, was captured off Norway in the course of a Commando raid by the British Army and the Royal Navy. On the trawler were the Enigma settings for the month of February 1941. Using these settings, Turing and his staff were able more or less to reconstruct the missing bigram tables and then to attempt to apply Turing's banburismus technique.
But it was not to be Turing or any of the other brilliant mathematicians working alongside him who were to make the leap that would allow the code to be broken once and for all. Turing's banburismus method did not work at first, and the naval enigma code might not have been broken for months had it not been for the lateral thinking of Harry Hinsley, then aged 22, a history undergraduate, who had interrupted his studies to join Naval Intelligence at Bletchley. It was Hinsley who, at the end of April 1941, identified the Enigma's fatal flaw. Turing had told him that the code breakers were still stuck. So Hinsley knew that the only material he had to work with were the February 1941 decrypts read as a result of the March 1941 capture of the Krebs. That did not deter Hinsley who, in the course of his medieval studies, had become adept at making the most of scant historical evidence. While he was pouring over the messages once again, it dawned on him that he had missed something that had been staring him in the face for days; the same enigma code books used on the heavily armed U Boats that were so difficult to capture were also being used aboard isolated and unprotected trawlers. The trawlers, which were transmitting weather reports to the Germans, were in their turn being sent naval enigma messages.
Although the weather ships were not enciphering their weather reports on enigma machines, they had to have one of the machines on board if they were to decode the enigma signals transmitted to them. This was an act of almost unbelievable folly since, if the code books could be captured from one of these vulnerable trawlers, the naval enigma system, used by the U Boats, Nazi Germany's most effective weapon, would be compromised. Hinsley had discovered Enigma's Achilles heel! He immediately told the Admiralty what he had found out. Then he explained how the discovery might best be exploited. If the Royal Navy were to send a warship to board one of the weather ships, the German crew would doubtless have time to throw their current enigma settings into the sea before they were boarded. However, Hinlsey was almost certain that the next month's Enigma settings would be locked in a safe. That being the case, he reasoned, if the Germans were frightened sufficiently by the warships guns, the locked up codebooks might well be forgotten when the ships were abandoned. The Admiralty accepted Hinsley's hypothesis. At the beginning of May 1941, no fewer than seven destroyers and cruisers were sent to the northeast of Iceland where the Munchen, one of the weather ships, was operating. In the course of the raid, the weather ship, and the Enigma settings for June 1941, were captured. As a result of this planned capture, and not as a result of the fortuitous capture of the U-100 two days later, naval enigma messages transmitted during June 1941 were read almost as soon as they were sent.
But halfway through June 1941, Turing had to ask for Hinsley's help again. The German's had replaced the bigram tables worked out so painstakingly by the British code breakers. This was a serious problem for the code breakers. Since Bletchley Park needed to read Enigma messages for about a month to be able to construct the new tables, and since the code breakers only had Enigma settings for the two week period ending at the end of June, there would be a code breaking blackout unless further settings were captured. But Hinsley and the Admiralty were concerned that capturing another weather ship might give the game away. There was no point in seizing the settings if the Germans immediately altered them because they knew they had been captured. So there were agonised discussions about what to do before the Admiralty decided to take a risk. On June 25th 1941 four warships set out from Scapa Flow to capture the codebooks from the Lauenburg, another weather ship operating north of Iceland, which Hinsley had selected. On the way Kim Skipwith, the Commander of the Destroyer HMS Tartar told his men that they were looking for a meteorological ship that was providing the Luftwaffe with weather reports. "If you chaps don't want your homes to be bombed, you'd better find her", he told them. He then warned Tom Kelly, his chief gunners mate, that when they found the ship he would be instructed to open fire but he must on no account hit the target. "That'll be very easy", Kelly retorted impudently. "I just want to encourage the crew to abandon ship, pronto", Skipwith explained.
At about 7pm on June 28th, a lookout on Tartar shouted "There's something over there, behind that iceberg!". That something was the Lauenburg. Shortly after Kelly's gunners opened fire, two lifeboats full of the Lauenburg's crew were seen being rowed away from the weather ship. Minutes later Tartar steamed alongside and a boarding party led by Lieutenant Hugh Wilson leapt aboard. They were joined by Allon Bacon, a Naval intelligence officer. "There's nothing much here", Wilson told him. Nodding dismissively at the disorganised piles of paper lying in the charthouse and on the deck, he added "You don't want this rubbish do you?". To which Bacon replied that he wanted it all and declared himself satisfied only when all the paper had been bagged and taken to Tartar. Only then was Kelly instructed to fire on and sink the Lauenburg. On the journey back to Scapa Flow, Bacon closeted himself in the Officer's day cabin to sort out the documents. Wilson looked in from time to time to offer him a cup of gin, but Bacon refused to be distracted. When Tom Kelly popped his head round the door and asked Bacon if he had found what he was looking for, Bacon, who had disappointed the Task Forces Commander by not bringing back an enigma machine said, "No, but I've found something a damn sight more important". Among the mass of charts and signaling papers he had come across three loose sheets that Hinsley had hoped he would find. Two of these were headed Steckerverbindungen (plug connections) and one was a list of the Innere Finstellung (inner settings) i.e.: the enigma wheel order, and the settings for the rings around the wheels that could be altered only by fiddling around inside the Enigma machine. It was thanks to these documents that naval enigma messages were read throughout most of July 1941, and also that the latest set of bigram tables were finally reconstructed, which opened the way for Turing and his team to exploit his banburismus procedure. From the beginning of August 1941 Turing and his colleagues were able to break the naval enigma code using the banbarismus procedure with an average delay of about 50 hours. For the moment the battle for the naval enigma code was won.
Indeed code breaking via enigma became so successful that the British warned the US that several U Boats were on route to the Eastern Seaboard to attack US shipping. The Admiral in Charge, an anglophile, refused to do anything as it "came from those Brits" and as a consequence, he lost 500+ ships before action was taken. The U Boat commanders refered to this as the "Happy Time". The Hollywood version "U571" is purely that - just Hollywood!
Damn nifty, thanks for that. :)
01-31-02, 03:43 PM
Your welcome, blue!:rolleyes:
I am very excited to answer this question as i just read Tanenbaum.
I"ll try to explain encryption algorithms as far as i know.
Let us start from the basics.first of all what is the difference between authentication and authorization.
well this can be explained by this example:
1.)Is this Scotts process?(Authentication)
2.)Is Scott allowed to run this process?(Authorization).
Now the encryption is a part of Authentication.the basis is simple.each of the user has to send Data over the net for a specific purpose,but lets say its secret,suppose its regarding something as crazy as UFOs to president of U.S,in that case i would want that no one can understand my data except the reciever intended isnt it?
so what i"ll do is that i"ll <b>encrypt</b>it to a non-understandable form.this form for reciever to understand has to be decrypted or is to be converted to a usable or understandable form.
each of the above that is encryption,decryption requires a set of proceedure,rules to be done,these rules are called encryption or decryption algorithms or simply <B>KEYS</B>.these keys can be kept Private or public according to our requirement.
if have grasped the above portion lets begin:
the techniques for authentification are different.
<color=blue>SHARED SECRET KEY</COLOR>
in this both the users know each others keys(that is algorithms for encryption and decryption)now,if lets say alice wants to send a message to BOB,she"ll send it over using shared secret key(secret encryption algorithm of Alice,that is known to Bob),when Bob recieves message he can decode it using Alice's Key(decryption algorithms of Alice that is known to Bob).
If in above Bob has to send a message to Alice,Alice will decrypt the message using Bob 's key.
the technique i describe for cryptography is called a secret key cryptography.however it has serious flaws so it couldnt be implemented properly.
Later <color>blue>Public key Cryptography</color>
was given which is by and large widely used.this uses a twin key concept.
Every user has two keys public key,private key(encryption/decryption algorithm)so let us again take Alice and Bob's example:
Now suppose Alice wants to send message to Bob,she then encrypts the message using BOBs public key(kept public purposefully)and sends it to Bob,this means that Bob will recieve the message and will decrypt it?isnt it?
this is how it works.
if you want me to get over to DES etc,i can help you out in that too.
03-09-02, 02:05 PM
Thanks I think! I will need top read it several times in order to understand it!!!:rolleyes:
Which part you cant understand?Public and private keys.??:confused:
i can try to explain again,
03-09-02, 02:19 PM
I'll let you know when I have re-read it a few times, but not tonight; brain in death mode due to working a 12 hour day! :rolleyes:
Yeah i get it.well if ya got problems,plz do reply,i am eager to explain this B.S to everyone.
03-09-02, 02:31 PM
In Binary my brain is in "0" mode!!:rolleyes:
There are two things that make me laugh most Rolleyes,and that angry sign.just great...
continue zero mode with RS Flip Flops...(Clear condition);)
If you actually wished to create an encryption program, basically one that allowed two people to share private messages via your second method, how would you do it easily?
The only thing I have come up with so far, is to convert characters to their integer equivalaints (sp) and then perform some form of math on these numbers. Making it impossible to do a direct character integer to ascii.
Then for the decryption, the other person does the reverse of the math. However, this makes it so that the encrypt is basically the same as the decrypt, making them both private.
Encryption and breaking encryption via algorithms and the computer has always interested me, and since you seem to know more then I do, I figured I would ask :).
Do you mean Algorithmic Encryptions or Decryption...
Send the messages via computer and the pass the key to each other by telephone each day. Even better, both ends watch the same weather report or something each night. Select the first five words the weather reporter says, whatever they are, and that is your key. Anything like that is good. People did it a lot on WW2, and still do.
Now, you have your key, brand spanking new each day.
You set your programme each day right after the report to encrypt and decrypt only with that key.
As for the actual encryption method using that key, well, just make something up. A=%, B=-, C=L, D=;, whatever. Even better, have each letter described by the key divided by that letter's place in the alphabet plus half the key along the alphabet. For example: If the key phrase from the weather report is 24 characters long, and you encrypt a "D", it is encrypted to (24/4)+12, meaning the D would be replaced by something 18 characters from the start of the alphabet (you count it out). Because the number of letters in the first five or ten words of the weather report changes every day, the key for doing that is always different. There's no limit to how you can work an encryption programme. Any tricky crap you can imagine will work fine if you write it well.
okay let me start with DES.
In 1977 the U.S govt adopted a product Cipher developed by IBM as its official standard for passing secret information.Classified shit and all...This cipher,DES(DATA ENCRYPTION STANDARD)was widely adopted by Industry untill it was proved that it was too vulnerable for attacks and breaking authentification.
But the Modified form is still useful.
<color=blue>ACTUAL METHOD OF ENCRYPTION</color>
Plain text is encrypted in blocks of 64 bits,yielding 64 bits of Cipher text.this is done using 56 bit key.
The algorithm is parametrized by a 56 bit key,which has 19 distinct stages.The first stage is independent of key usage.the original text is first taken and scrambled into different pieces,randomly,(although that randomness is also defined;))
this is primarily known as Independent transposition.The last stage is exact inverse of the first stage.the stage prior to last one exchanges the lefmost 32 bits with right most 32 bits.the remaining 16 stages are functionally identical but are parametrized by different functions of key.the algorithm has been designed to allow Decryption to be done with same key as encryption.the steps are just in reverse order.
Contd.in next post...
(This is done in order to make it less boring for you guys;))
The 2nd last stage is called 32-Bit swapping step.the actual 56 bit key is applied at the second step.
which undergoes 16 iterations.
each stage takes 32 bit inputs and produces 32 bit outputs.the left output is simply a copy of right input.the right output is bitwise EXCLUSIVE -OR of left input and a function of right input and key for this stage.all the complexities lies within this function.
the function consists of four steps essentially:
FIRST,a 48-bit sequence number E,is constructed by expanding 32-bit R according to fixed transpostion and duplication rule.
SECOND, and K are EXCLUSIVE-ORed together.this output is then partitioned into eight groups of 6bits each,each of which is fed in a S-box.each of 64 bit possible inputs to S box is mapped onto 4-bit output.Finally,Thes 8x4 bits are passed through a P-box.
In each of 16 iterations a different key is used.before the algorithm starts,a 56-bit transposition is applied to the key.Just before each iteration,the key is partitioned specifically into 28-BIT units,each of which is rotated left by a number of bits depending upon iteration number.K is derived from rotated key by applying yet another 56 bit transposition to it.a different 48-bit subset of 56 bits is extracted and permuted on each round...
To be continued later...
(DES CHAINING AND HOW TO BREAK DES CODES!)
Logic and others,
if you want to me to explain exact algorithms of public key RSA etc,i can get details...
As early as 1979 IBM realised that DES key length was pretty short and therefore an effective way must be devised to improve the Loop hole and enhance the standard efectively.
hence cam Triple encryption.
In first stage,pliantext is encrypted with K1,in second stage K2 DES is run in decryption mode.Finally another encryption is carried out using K1,the recievers end is exactly opposite.
The explainations given here about public and private key encryption seem a bit confused, so I'll try to clarify.
The encryption used in RSA is based on a function that is practically impossible to inverse without having the correct key. This means that anyone can encrypt the message but after encryption you can not decrypt the message back to its original.
So if Bob wants to send Alice a message, Bob uses Alice's public key, which is availble to anyone, to encrypt the message. In order to decrypt the message one must also know the private key associated with the public key used for encryption. And the only one that knows this secret private key is Alice, who has it stored on her computer. So then Alice can decrypt the message.
Hey are you a Tanenbaum Freak?:D
if you are...well let me into the party...;)