HOW A HACKER remembers A PIN

If you have more than a few bank cards, door-entry keycodes, or other small numeric passwords to remember, it eventually gets to be a hassle. The worst, for me, is a bank card for a business account that I use once in a blue moon. I probably used it eight times in five years, and then they gave me a new card with a new PIN. Sigh.

Quick, What’s My PIN?
How would a normal person cope with a proliferation of PINs? They’d write down the numbers on a piece of paper and keep it in their wallet. we all know how that ends, right? A lost wallet and multiple empty bank accounts. how would a hacker handle it? write each number down on the card itself, but encrypted, naturally, with the only unbreakable encryption scheme there is out there: the one-time pad (OTP).

The OTP is an odd duck among encryption methods. They’re meant to be decrypted in your head, but as long as the secret key remains safe, they’re rock solid. If you’ve ever tried to code up the s-boxes and all that adding, shifting, and mixing that goes on with a normal encryption method, OTPs are refreshingly simple. The tradeoff is a “long” key, but an OTP is absolutely perfect for encrypting your PINs.

The first part of this article appears to be the friendly “life-hack” pablum that you’ll get elsewhere, but don’t despair, it’s also a back-door introduction to the OTP. The second half dives into the one-time pad with some deep crypto intuition, some friendly math, and hopefully a convincing argument that writing down your encrypted PINs is the right thing to do. Along the way, I list the three things you can do wrong when implementing an OTP. (And none of them will shock you!) but in the end, my PIN encryption solution will break one of the three, and remain nonetheless sound. curious yet? อ่านต่อ.

The PIN Solution

So first the solution to the bank card problem: write your PIN encrypted with a secret that only you know. instead of needing to remember a four-digit number for each new card, you’ll just need one four-digit number forever. The key is to choose an encryption scheme that’s easy enough to undo so that you won’t look too strange when asked to type the PIN in at the bank teller’s window. This is the classic use of the OTP — an encryption that you can undo in your head.

First, randomly select a secret four-digit number. Then, subtract that number from your PIN and write the result on your card. To get your PIN, when standing in front of the bank teller, simply look down at the card and add the secret number back. The teller will think that you’ve written your PIN on the card. feel free to feel smug, because you’ve used an unbreakable encryption scheme.

Instead of normal addition and subtraction, with the carrying and borrowing across digits, you will want to use modulo-10 math — adding or subtracting ten from the result any time it gets outside the range 0-9. We’ll talk about why below, but for now, here’s a working example.

Suppose the PIN is 1234 — it has to happen so someone, right? — and my random secret number is 1337, naturally. Let’s encrypt. Subtracting 1 from 1 gives a zero, so I write that down. Subtracting 3 from 2 gives -1, which is where the modulo-10 arithmetic comes in. In this case, -1 turns into 9 by adding ten. 3 – 3 = 0, and 4 – 7 = 7, mod-10. My card now has 0907 written on it.

Now let’s decrypt. looking down at the card, I see a 0 and add 1. 9 + 3 = 12, however, so we’ll need to subtract ten to get 2. (That’s the reason to choose addition for the decryption stage, it’s easy to just drop any leading 1s.) 0 + 3 = 3 and 7 + 7 = 14 -> 4<. I type in 1234, and the money is mine! Once you get the hang of adding your secret number to any other number, digit-wise mod-10, you’ll be surprised how quickly it will work. try it out and see if you get good at it within ten minutes. One-Time Pads A one-time pad is both the simplest symmetric encryption scheme and also completely unbreakable. It has three crucial features, two of which were demonstrated above, and getting any of them wrong can be catastrophic. The most important feature of an OTP is that the password needs to be random, and the same length as the text that it encrypts — hence the four-digit secret for the PIN. In an OTP, everything revolves around the secret, which is also its Achilles’ heel. For a four-digit number, keeping a four-digit secret is no problem. but imagine that you want to send gigabytes of encrypted photos of your vacation to a friend. That’s a lot of key material to keep on-hand and secret. Original by [Matt_Crypto], Public DomainSecond, the method of combining the message with the secret has to be similar to the modulo arithmetic, in that the set of encrypted characters and the set of plaintext characters — the PIN in our example — have to map หนึ่งต่อหนึ่ง. Mod-10 ensures this easily: both are in the range 0-9. maybe you’re familiar with using the XOR operator on binary data, which is the same thing as either additiในการลบหรือลบ MOD-2 (0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, และ 1 + 1 = 2 -> 0. QED) คุณสามารถใช้ตัวอักษรและห่อตัวอักษรรอบ ๆ ที่ “Z” เช่น Caesar Cipher หรือ rot13 ซึ่งกำลังทำแผนที่ตัวอักษรเป็นตัวเลขและทำ MOD MOD-26

ประการที่สามและบางทีนี่อาจเป็นข้อเสนอแนะของครั้งแรกคุณไม่ควรใช้ความลับในแผ่นเดียว คุณคิดว่านี่เป็นที่ชัดเจนเนื่องจากมันเป็นชื่อของวิธีการเข้ารหัส แต่มันยากที่จะทำในการปฏิบัติ และในความเป็นจริงรูปแบบการเข้ารหัส PIN ของฉันแบ่งกฎนี้โดยใช้ความลับเดียวกันในหลาย ๆ คีย์ เราจะเข้าไปในเร็ว ๆ นี้

การเข้ารหัสที่สมบูรณ์แบบ

ทำไม otp otp แตก? การทำลายแผนการเข้ารหัสส่วนใหญ่มักจะเดือดลงไปสู่ความน่าจะเป็นและสถิติ ตัวอย่างเช่นหากคุณเข้ารหัสข้อความด้วย Caesar Cipher ด้านบนตัวอักษรแต่ละตัวในข้อความธรรมดาจะถูกแมปกับตัวอักษรตัวเดียวอื่นทุกครั้งที่เกิดขึ้นใน ciphertext หากคุณรู้ว่าข้อความต้นฉบับเป็นภาษาอังกฤษซึ่งตัวอักษรที่ใช้กันมากที่สุดคือ “E” มันเป็นทางออกที่ดีที่ถ้า “Q” เป็นตัวอักษรที่พบบ่อยที่สุดใน ciphertext มันย่อมาจาก “E” นั่นคือเราพบว่ามีความคล้ายคลึงกันทางสถิติระหว่างธรรมดาและ ciphertext และใช้เพื่อสร้างสะพานระหว่างสอง

การใช้คีย์ลับที่ตราบเท่าที่ข้อความธรรมดาและสุ่มเลือกแบ่งความสัมพันธ์ทางสถิติกับ ciphertext เนื่องจาก ciphertext เฉพาะที่เขียนลงบนการ์ดของฉันทุก ๆ PIN จาก 0000 ถึง 9999 และหากคีย์ถูกเลือกแบบสุ่มมีแนวโน้มอย่างเท่าเทียมกัน ไม่มีข้อมูลเกี่ยวกับข้อความธรรมดาใน Ciphertext – นั่นเป็นข้อพิสูจน์ของ Claude Shannon (PDF คลาสสิกอย่างแน่นอน) โดยย่อ และนั่นเป็นสาเหตุที่ OTP ไม่สามารถแตกได้

Diana แผ่นครั้งเดียว [US NSA], Domainthis สาธารณะเป็นกุญแจสำคัญในการทำความเข้าใจกับสาขาการเข้ารหัส: เป็นความพยายามที่จะไต่ข้อมูลเกี่ยวกับข้อความธรรมดาในระหว่างกระบวนการเข้ารหัสเพื่อให้มีการใช้งานที่สั้นกว่าไม่มี ร่องรอยที่เกี่ยวข้องทางสถิติของคำลักพังที่ยังคงอยู่ ความปรารถนาอันสั้นนี้ไม่ได้เป็นเพียงเรื่องของความสะดวกสบายเช่นกัน: ลองนึกภาพว่าคุณและแฮ็กดาเดย์ต้องแลกเปลี่ยน 500 kib ของข้อมูลแบบสุ่มเพียงเพื่อดาวน์โหลดบทความนี้และอ่าน ลองนึกภาพความยาวของรหัสผ่าน WiFi ที่คุณต้องเขียนสำหรับแขก! นี่คือความรู้สึกที่ OTP เป็นเรื่องเล็กน้อยและไม่น่าสนใจ – อาจแตกได้ แต่ความลับยาวเกินไปสำหรับแอปพลิเคชันส่วนใหญ่ Crypto จริงเกี่ยวกับการค้นหาอัลกอริทึมที่ทำลายความสัมพันธ์ทางสถิติด้วยวัสดุสำคัญขั้นต่ำ

ในใจคุณสามารถสกรูการใช้งาน OTP ได้โดยใช้รหัสผ่านสั้นหรือไม่ใช่แบบสุ่ม ลองนึกภาพการใช้ 1 เป็นรหัสผ่านของคุณและทำซ้ำตามความจำเป็น Ciphertext ของเราจะอ่าน 2345 และพินจะเดาได้ในการลองครั้งที่สอง คุณยังต้องการใช้รหัสผ่านแบบสุ่ม การหยิบ 0000 เพราะมันทำให้คณิตศาสตร์ง่ายเป็นสิ่งเดียวที่เลวร้ายยิ่งกว่าข้างต้น (แม้ว่าการพูดอย่างเคร่งครัดฉันจะม้วนอีกครั้งถ้าฉันได้ 0000, 1111, 9999, 1234, 4321 หรือคล้ายกัน) อย่างไรก็ตามอย่าใช้วันเกิดของคุณ หมายเลขโทรศัพท์เก่าของเพื่อนในวัยเด็กอาจเป็นที่ยอมรับ

บทบาทของ Modulo Arithmetic เป็นที่ลึกซึ้งยิ่งขึ้นเล็กน้อย ฟังก์ชั่นใด ๆ ที่ใช้ชุดของอักขระที่เป็นไปได้ในข้อความธรรมดาต้องแมปแบบหนึ่งต่อหนึ่งกับ ciphertext ทำไม? ลองนึกภาพว่าคุณใช้การเพิ่มที่เรียบง่ายแทนการเพิ่ม MOD-10 ในการรับหลักสุดท้ายของ Pin Ciphertext ของเราเราใช้ 4 – 7 = -3 -> 7 และถอดรหัสด้วย 7 + 7 = 14 -> 4. ถ้าเราเขียนลง -3 แทนผู้โจมตีจะรู้ว่าหลักสุดท้ายของเรา ‘t มากกว่า 6 เพราะการเพิ่ม 9 ค่าสูงสุดให้เพียง 6. เรามีข้อมูลรั่วไหลโดยการตั้งค่าที่ใหญ่กว่าใน ciphertext มากกว่าในข้อความธรรมดา

และนั่นทำให้วิธีสุดท้ายในการเลอะ: การใช้แผ่น “เพียงครั้งเดียว” ชัดเจนใช่มั้ย ผิด.

เครื่อง lorenz, โดเมนสาธารณะ
ในมือข้างหนึ่งนำมาใช้ซ้ำเป็นความรับผิดที่ชัดเจน การใช้รหัสผ่านอีกครั้งในรูปแบบการเข้ารหัสที่คล้ายกันมากทำลาย “Tunny” ซึ่งเป็นรหัสที่สำคัญในช่วงสงครามโลกครั้งที่สอง ส่งข้อความเข้ารหัสอักขระ 4,000 ตัว แต่ไม่ได้รับอย่างถูกต้อง ผู้ส่งส่งข้อความอีกครั้งด้วยความลับเดียวกัน แต่ทำการเปลี่ยนแปลงเล็กน้อยในข้อความโดยใช้ตัวย่อที่แตกต่างกันและอื่น ๆ สิ่งนี้ทำให้พันธมิตรเพียงพอที่จะทำลาย Tunny และ Reverse Engineer เครื่องที่เข้ารหัสมัน จบเกม.

นี่คือคณิตศาสตร์ที่ทำให้ Tunny Decrypt ทำงานและควรโน้มน้าวให้คุณไม่เคยใช้กุญแจอีกครั้ง หากเราเข้ารหัสข้อความ A และ B ด้วยคีย์ลับ C และใครบางคนได้ยินทั้งคู่พวกเขาสามารถทำได้ด้วยกันเพื่อรับ (m mod c) mod (b mod c) = (mod b) mod c mod c = a mod c mod c = a Mod B โดยที่ Mod เป็นผู้ดำเนินการโมดูโลที่ฉลาดหรือมีจำนวนที่เราคุ้นเคย เนื่องจากการใช้โมดูโลไบนารี่เป็นสิ่งที่ตรงกันข้ามของตัวเองผลที่ได้คือสิ่งที่เกี่ยวข้องกับทั้งแบบธรรมดาและเป็นอิสระจากคีย์ลับ

จากที่นี่เปรียบเทียบการคาดเดาอย่างชาญฉลาดสำหรับ A และ B และการเปรียบเทียบกับผลลัพธ์ MOD B สามารถทำลายรหัสได้ ดังนั้นหากคุณแน่ใจว่า “การโจมตี” ปรากฏในทั้งข้อความ (ประเภท Crypto จะเข้ารหัส “การโจมตีที่ Dawn”)จากนั้นคุณสามารถลอง Modding “Attack” ด้วยกันในตำแหน่งที่แตกต่างกันจนกว่าคุณจะได้รับการแข่งขันกับ Mod B.

ที่น่าประหลาดใจตอนจบ

แต่นี่คือการบิดครั้งสุดท้าย! เราสามารถหนีไปได้กับการใช้คีย์ลับในบัตรธนาคารทั้งหมดของเราแม้จะมีคณิตศาสตร์ข้างต้น ทำไม? เพราะหมุดตัวเองเป็นแบบสุ่ม ในทางตรงกันข้ามกับข้อความภาษาธรรมชาติที่ส่งในช่วงสงคราม B mod b นั้นสุ่มเป็น Mod C หากทั้ง A และ B เป็นหมุดแบบสุ่ม

ดังนั้นนี่คือวิธีที่แฮ็กเกอร์จดจำหมุด: โดยการเรียนรู้มากมายเกี่ยวกับแผ่นเดียววิธีการทำลายและวิธีการที่มันมีประโยชน์หากข้อความที่ต้องการป้องกันสั้น และวิธีการสำหรับข้อความเฉพาะคุณสามารถทำลายกฎได้

Leave a Reply

Your email address will not be published. Required fields are marked *