सम्झना गर्दछ यदि तपाईंसँग केहि बैंक कार्डहरू, ढोका-प्रविष्टि कुञ्जीकोडहरू, वा अन्य सानो संख्यामा पासवर्डहरू याद छ भने अन्ततः एउटा समस्या हुन्छ। सबैभन्दा खराब, मेरो लागि, एक व्यापार खाता को लागी एक बैंक कार्ड हो जुन म एक पटक नीलो चन्द्रमामा प्रयोग गर्छु। मैले सायद पाँच बर्षमा आठ गुणा यसको प्रयोग गरें, र त्यसपछि उनीहरूले मलाई नयाँ कार्ड दिए। Sigh
छिटो, मेरो पिन के हो?
एक सामान्य व्यक्तिले कसरी पिनहरूको विस्तारको सामना गर्ने थियो? तिनीहरूले कागजको एक टुक्रामा नम्बरहरू लेख्न र यसलाई आफ्नो वालेटमा राख्दछन्। हामी सबैलाई थाहा छ कि त्यो कसरी अन्त हुन्छ, ठीक छ? एक हराएको वालेट र बहु खाली बैंक खाताहरू। एक ह्याकरले यसलाई कसरी ह्यान्डल गर्ने थियो? त्यहाँ कार्डमा प्रत्येक नम्बर लेख्नुहोस्, तर ईन्क्रिप्टेड, केवल एक मात्र अटुट ईन्स्क्रिप्शन योजनाको साथ, त्यहाँ बाहिर छ: एक समय प्याड (OTP)।
ओटीपी एन्क्रिप्शन विधिहरू बीच एक अनौठो डक हो। उनीहरूको टाउकोमा डिक्रिप्ट हुने हो, तर जबसम्म गोप्य साँचो सुरक्षित रहन्छ, तिनीहरू ठोस रकहरू हुन्। यदि तपाईंले कहिल्यै एस-बक्सहरू र सबै थप्न, शिफ्ट गर्दै, र मिसाउने सबै सामान्य ईन्क्रिप्शन विधिको साथमा जान्छ, ओटीपीहरू स्फूर्तिदायी रूपमा सरल हुन्छन्। ट्रेड अफ एक “लामो” कुञ्जी हो, तर ओटीपी तपाईंको पिनहरू अति नै उत्तम छ।
यस लेखको पहिलो भाग मित्रैलो “जीवन-ह्याक” Pablum जुन तपाईं कहिँ पनि फेला पार्नुहुनेछ, तर निराश नहुनुहोस्, यो पनि ओटीपीमा फिर्ता ढोका हो। दोस्रो आधा डोभ्स एक-समय प्याडमा गहिरो क्रिप्टो अन्जाइज, केही मैत्री गणित, र आशापूर्वक एक विश्वस्त छ कि तपाईंको ईन्क्रिप्टेड पिनहरू लेख्न सही कुरा हो। बाटोमा, म तीन चीजहरू सूचीबद्ध गर्दछु तपाईंले OTP कार्यान्वयन गर्दा गलत गर्न सक्नुहुनेछ। (र ती मध्ये कुनै पनि तपाईंलाई चकित हुनेछैन!) तर अन्तमा, मेरो पिन ईन्क्रिप्शन समाधानले तीन जनालाई तोड्नेछ, र जे होस् भनेर ध्वनि रहनेछ। जिज्ञासु अझै? पढ्न पढ्नुहोस्।
पिन समाधान
यसैले पहिले बैंक कार्ड समस्याको समाधान: एक रहस्यको साथ तपाईंको पिन लेख्नुहोस् जुन तपाईंलाई मात्र थाहा छ। प्रत्येक नयाँ कार्डको लागि चार-अंक नम्बर सम्झनुको सट्टा तपाईलाई सँधै एक चार-अंक नम्बर चाहिन्छ। कुञ्जी एक ईन्क्रिप्शन योजना छनौट गर्नु हो जुन अनडुट गर्न पर्याप्त सजिलो छ कि बैंक टेलरलको विन्डोमा पिन टाइप गर्दा तपाईंलाई धेरै अनौंठो देखिने छैन। यो OTP को क्लासिक प्रयोग हो – एक ईन्क्रिप्शन जुन तपाईं आफ्नो टाउकोमा अन्डु गर्न सक्नुहुन्छ।
पहिले, अनियमित रूपमा एक गोप्य रूपमा चार-अंक नम्बर चयन गर्नुहोस्। त्यसो भए तपाईंको पिनबाट त्यो नम्बर घटाउनुहोस् र तपाईंको कार्डमा परिणाम लेख्नुहोस्। तपाईंको पिन प्राप्त गर्न, जब बैंक टेलर अगाडि उभिन्छ, केवल कार्डमा तल हेर्नुहोस् र गोप्य संख्या फिर्ता थप्नुहोस्। टेलरले सोच्दछ कि तपाईंले आफ्नो पिन कार्डमा लेख्नु भएको छ। SMGG महसुस गर्न नहिचकिचाउनुहोस्, किनकि तपाईंले एउटा अटुट ईन्क्रिप्शन योजना प्रयोग गर्नुभयो।
सामान्य थप र घटाउनको सट्टा, बोक्ने र अंकहरू पार गरेर र उधारो लिने साथ, तपाईं मोड्युलो-10 गणित प्रयोग गर्न चाहानुहुन्छ – कुनै पनि समय बाहिर 0-9 को दायरा बाहिर निस्किन्छ। हामी तल किन को बारे मा कुरा गर्नेछौं, तर अब को लागि, यहाँ एक कार्य उदाहरण छ।
मानौं कि पिन 123434 छ – यो केहि हुनु पर्छ, हैन? – र मेरो अनियमित गोप्य संख्या 13373737 हो, प्राकृतिक रूपमा। हामी ईन्क्रिप्ट गरौं। 1 बाट घटाइच 1 बाट शून्य दिन्छ, त्यसैले म तल लेख्छु। 2 बाट fubloging -1 ले -1 दिन्छ, जहाँ मोड्युलोको 10 10 अंकगणित हुन्छ। यस केसमा, 10 मा 10 मा हुन्छ। – – = = 0, र – = = = 7, MAD-10। मेरो कार्ड अब यसको 0907 यसमा लिखित छ।
अब हामी डिक्रिप्ट थियौं। कार्डमा तल हेर्दै, म 0 + + + + + 3 + = 12 थप्नेछु, यद्यपि हामी 10 प्राप्त गर्न 10 डिस्क्रिप्शन चरणको लागि थप गर्न आवश्यक छ, यो केवल गर्न सजिलो छ कुनै पनि अग्रगामी 1s ड्रप गर्नुहोस् म 12 123434 मा टाइप गर्छु, र पैसा मेरो हो!
एकचोटि तपाईंले कुनै पनि अन्य नम्बर, अंक-बुद्धिमान मोड-10 मा तपाईंको गोप्य संख्या थप्न को लागी पाउनुभयो, तपाईं कत्ति चाँडो काम गर्ने भनेर अचम्मित हुनुहुनेछ। यसलाई बाहिर प्रयास गर्नुहोस् र हेर्नुहोस् यदि तपाईंले दस मिनेट भित्रमा राम्रो पाउनुभयो भने।
एक पटक प्याडहरू
एक समय प्याड दुबै सरल सममित ईन्क्रिप्शन योजना हो र पूरै अटुट पनि छ। यसमा तीन महत्त्वपूर्ण सुविधाहरू छन्, जसमध्ये दुई माथि देखाइएको थियो, र तिनीहरूलाई कुनै पनि गल्ती विनाश हुन सक्दैन।
ओटीपीको सब भन्दा महत्त्वपूर्ण विशेषता यो हो कि पासवर्ड अनियमित हुनु आवश्यक छ, र समान लम्बाई पाठको रूपमा पाठको रूपमा जुन यो ईन्क्रिप्ट्स हो – पिनका लागि चार-अंक गोप्य रहस्य। OTP मा सबै कुरा गोप्य वरिपरि घुम्छन्, जुन यसको अचिलीको कुर्कुच्चो हो। चार अंक नम्बरका लागि, चार अंकको रहस्य राख्दै कुनै चार-अंक गोप्य राख्दैन। तर कल्पना गर्नुहोस् कि तपाईं आफ्नो छुट्टीको ग्रेक्रिप्टेड फोटोहरू साथीलाई साथीको ईन्क्रिप्टेड फोटोहरू पठाउन चाहानुहुन्छ। त्यो राम्रो सामग्री र गोप्य राख्नको लागि धेरै कुञ्जी सामग्री हो।
[AT_CREPTO], सार्वजनिक डोमेन स्क्वायर द्वारा संयोजन गर्ने विधिबाट मूल रूपमा असन्तुष्टसँग मिल्दो हुनुपर्दछ, कि ईन्क्रिप्टेड चरित्रहरूको सेट – हाम्रो उदाहरणको सेट – नक्शामा पिन एक देखि एक। Mod-10 ले यसलाई सजिलै सुनिश्चित गर्दछ: दुबै दायरा 0- .. मा छन्। हुनसक्छ तपाईं बाइनरी डेटामा Xor अपरेटरको साथ परिचित हुनुहुन्छ, जुन या त थपिएका जस्तै कुरा होon or subtraction, mod-2. ( 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 2 -> 0. QED.) You can also use letters and wrap the alphabet around at “z” like the Caesar cipher or ROT13, which is just mapping the alphabet into numbers and doing math mod-26.
Third, and maybe this is a corollary of the first, you shouldn’t re-use the secret in a one-time pad. You’d think that this was obvious, since it’s even in the name of the encryption method, but it’s hard to do in practice. and in fact, my PIN-encryption scheme breaks this rule by using the same secret across multiple keys. We’ll get into that soon.
Messing up the perfect Encryption
Why is a OTP unbreakable? breaking most encryption schemes often boils down to probability and statistics. For instance, if you encrypt a text with the Caesar cipher above, each letter in the plaintext is mapped to another single letter every time it occurs in the ciphertext. If you know that the original text is in English, where the most commonly used letter is “e”, it’s a good bet that if “q” is the most common letter in the ciphertext, it stands for “e”. That is, we find statistical similarities between the plaintext and the ciphertext, and use them to make a bridge between the two.
Using a secret key that is as long as the plaintext, and randomly chosen, breaks any statistical relationship with the ciphertext. given a specific ciphertext written down on my card, every PIN from 0000 to 9999 is possible, and if the key was chosen randomly, is equally likely. There is no information about the plaintext in the ciphertext — that’s essentially Claude Shannon’s proof (absolutely classic PDF) in a nutshell. and that’s why an OTP is unbreakable.
DIANA one-time Pad [US NSA], Public DomainThis is actually the key to understanding the field of cryptography: it is an attempt to scramble up the information about the plaintext during the encryption process so that even though a shorter key is used, no statistically relevant traces of the plaintext remain. This desire for short keys isn’t just a matter of convenience either: imagine that you and Hackaday had to previously exchange 500 KiB of random data just to download this article and read it. imagine the length of the WiFi password that you’d have to write down for guests! This is the sense in which the OTP is trivial and uninteresting — it may be unbreakable, but the secrets are just too long for most applications. real crypto is about finding algorithms that break the statistical relationship with a minimum of key material.
With that in mind, you can screw up an OTP implementation by using a short or non-random password. imagine using 1 as your password and repeating it as necessary; our ciphertext would read 2345, and the PIN would be guessed on the second try. You also want to use a random password; picking 0000 because it makes the math easy is the only thing worse than the above. (Although, strictly speaking, I’d re-roll if I got 0000, 1111, 9999, 1234, 4321, or similar.) Anyway, don’t use your birthday. Old phone numbers of childhood friends might be acceptable.
The role of modulo arithmetic is a little more subtle. Whatever function is used, the set of possible characters in the plaintext has to map one-to-one with the ciphertext. Why? imagine that you used simple addition instead of mod-10 addition. To get the last digit of our PIN ciphertext, we used 4 – 7 = -3 -> 7 and decrypted with 7 + 7 = 14 -> 4. If we wrote down -3 instead, an attacker would know that our last digit couldn’t be greater than 6 because adding 9, the maximum value, gives only 6. We’ve leaked information by having a larger set in the ciphertext than in the plaintext.
And that leaves the last way to mess up: re-using the “one-time” pad. Obvious, right? गलत।
Lorenz Machine, Public Domain
On one hand, reuse is a definite liability. Re-using a password in a very similar encryption scheme broke “Tunny”, an important code during WWII. A 4,000 character encrypted message was sent but not received correctly. The sender re-sent the message, with the same secret but made small changes in the text, using different abbreviations and so on. This gave the Allies enough to break Tunny and reverse engineer the machine that encrypted it. खेल खत्तम।
Here’s the math that made the Tunny decrypt work, and should convince you to almost never reuse a key. If we encode the messages A and B with the secret key C, and someone overhears both, they can just mod them together to get (A mod C) mod (B mod C) = (A mod B) mod C mod C = A mod B, where mod is the bitwise or number-wise modulo operator that we’re now used to. since taking the binary modulo is its own reverse, the result is something that’s related to both plaintexts, and independent of the secret key.
From here, comparing smart guesses for A and B and comparing them with the A mod B result can break the code. So if you’re pretty sure that “attack” appears in both texts (crypto types always encrypt “attack at dawn”),त्यसो भए तपाईले बिभिन्न पदहरूमा मिटडिंग “आक्रमण” गर्न सक्नुहुनेछ जब सम्म तपाईं मोड बीको साथ मिल्नुहुन्न।
एक आश्चर्य अन्त्य
तर यहाँ अन्तिम मोड छ! हामी सबै बैंक कार्डहरू भर पापी कुञ्जीमा पनि टाढा जान सक्दछौं, माथीको बावजुद पनि हामी हाम्रा सबै बैंक कार्डहरू भर पाउँदछौं। किन? किनभने पिन आफै अनियमित छन्। विजयी भाषाका सन्देशहरूको विपरीत, एक मोड बी मोडको रूपमा एक मोड बी मा एक मोडको रूपमा अनियमित छ यदि दुबै A र B अनियमित पिनहरू हो भने।
त्यसैले यो कसरी एक ह्याकरले पिन सम्झना गर्दछ: एक-समय प्याड को बारे मा धेरै सिक्न, कसरी ब्रेक गर्न, र यो सुरक्षा गर्न आवश्यक छ यदि यो सुरक्षा छोटो छ भने यो छोटो छ। र कसरी, विशेष सन्देशहरूको लागि, तपाईं नियमहरू पनि भ break ्ग गर्न सक्नुहुनेछ।