# EP 12: แวะเล่าเรื่อง: Caesar Cipher

**URL:** <https://discuss.hashpire.io/t/ep-12-caesar-cipher/281>\
**Category:** Content Board\
**Tags:** beginner, article\
**Created:** [July 13, 2022, 3:13am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281 "2022-07-13T03:13:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namtan](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/namtan/32/23_2.png) [@Namtan](https://discuss.hashpire.io/u/Namtan)\
**Post date:** [July 13, 2022, 3:13am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/1 "2022-07-13T03:13:12Z")

</div>

![Caesar-Cipher-1](https://discuss.hashpire.io/uploads/default/original/1X/79c144456a14d45d25121fd848f21f7bb64db230.jpeg)

 ![Caesar-Cipher-2](https://discuss.hashpire.io/uploads/default/original/1X/b4124482d5dd300a816887cc23ed351054601f12.jpeg)

 ![Caesar-Cipher-3](https://discuss.hashpire.io/uploads/default/original/1X/a18146affe1b2508c46c34e0c6277114d93760da.png)

 ![Caesar-Cipher-4](https://discuss.hashpire.io/uploads/default/original/1X/603f802a920b4fb698f27b63d6317f851872f099.png)

 ![Caesar-Cipher-5](https://discuss.hashpire.io/uploads/default/original/1X/f66a49d2318af9a1f855c09683967fae75533e26.jpeg)

 ![Caesar-Cipher-6](https://discuss.hashpire.io/uploads/default/original/1X/c69014625bfb6c0fd1c7d09ad6222b1dc96fc6ba.png)

 ![Caesar-Cipher-7](https://discuss.hashpire.io/uploads/default/original/1X/4ea7527cf4ceebc23777ee334ed364f5692b2e73.png)

EP 12: แวะเล่าเรื่อง: Julius Caesar รัฐบุรุษผู้คิดค้นการเข้ารหัสแห่งจักรวรรดิโรมัน

 ![image](https://discuss.hashpire.io/uploads/default/original/1X/c5ff4a0fc3117814cedcbd4b9b4d896e5c8ce516.jpeg)

EP 12: แวะเล่าเรื่อง: Julius Caesar รัฐบุรุษผู้คิดค้นการเข้ารหัสแห่งจักรวรรดิโรมัน

เชื่อว่าหลาย ๆ คนคงเคยได้ยินชื่อของ “จูเลียส ซีซาร์” กันมาบ้างไม่มากก็น้อย ในแง่มุมตั้งแต่ความสามารถทางการรบไปจนถึงตำนานความรัก แม้กระทั่งเอาไปเชื่อมโยงเป็นซีซาร์สลัดก็มี (จริง ๆ แล้วไม่มีความเกี่ยวข้องใด ๆ เลย) แต่สิ่งที่คุณอาจจะยังไม่เคยรู้มาก่อน ก็คือ นอกจาก จูเลียส ซีซาร์ จะเป็นนักรบผู้น่าเกรงขามแห่งโรมัน เป็นรัฐบุรุษคนสำคัญผู้ทำให้อาณาจักรโรมยิ่งใหญ่มีชื่อเสียง เป็นผู้ประพันธ์ร้อยแก้วอันเลื่องชื่อชาวโรมัน และเขาก็ยังเป็นผู้ใช้ ศาสตร์ “Cryptography” ในการเข้ารหัสลับเพื่อใช้ส่งสารในกองทัพของเขา ในระหว่างการทำศึกสงคราม เพื่อป้องกันไม่ให้ศัตรูสามารถอ่านข้อความในสารรบนั้นได้หากสารนั้นถูกแย่งชิงไปอีกด้วย

ใน EP นี้เราจะพาไปดูกันว่า จูเลียส ซีซาร์ ใช้วิธีใดในการเข้ารหัสข้อความของกองทัพที่แข็งแกร่งจนสามารถตีชนะยึดเมืองมากกว่า 800 เมืองตั้งแต่ยุโรปตอนเหนือจนถึงยุโรปตอนใต้ จากสเปนไปเอเชียน้อย และไปจนถึงอียิปต์ได้

การเข้ารหัสที่ จูเลียส ซีซาร์ นำมาใช้ เป็นที่รู้จักกันในนามว่า “Shift Cipher Caesar’s Code” หรือ “Caesar Shift” หรือเราจะเรียกรวม ๆ เป็น “Caesar Cipher” ก็ได้ เป็นการเข้ารหัสแบบ Substitution Cipher (การเข้ารหัสโดยการแทนที่ตัวอักษร) โดยการแทนที่ตัวอักษรเดิมด้วยตัวอักษรตัวอักษรตัวที่ 3 นับจากตัวมัน เช่น A จะเเทนด้วย D , B จะเเทนด้วย E , C จะเเทนด้วย F , X จะเเทนด้วย A , Y จะเเทนด้วย B และ Z จะเเทนด้วย C เป็นต้น หรือเป็นการเลื่อนไป 3 ตำแหน่งจากตำแหน่งเดิม (Shiftment, n=3) หากเราทดลองเข้ารหัสแบบ Caesar Cipher Left Shift of 3 (เลื่อนทางซ้าย 3 ตำแหน่ง) จากคำว่า “HASHPIRE” จะเข้ารหัสได้เป็น “KDVKSLUH”

![caesar-cipher-left-shift-of-3-1](https://discuss.hashpire.io/uploads/default/original/1X/c287e3efb4117b81677ac616fb4e2774f7a69274.png)

 ![caesar-cipher-left-shift-of-3-2](https://discuss.hashpire.io/uploads/default/original/1X/405b6a3d94429b0ec3d4d97943b7f2bd7a13755b.png)

ในเวลาต่อมา Augustus ผู้ซึ่งเป็นหลานของ Julius Caesar ได้มีการเปลี่ยนสูตรการเข้ารหัสจากเดิม มาเป็นการแทนที่ตัวอักษรเดิมด้วยตัวอักษรตัวที่ 1 ไม่นับรวมตัวมัน เช่น A จะเเทนด้วย B และ B จะเเทนด้วย C เป็นต้น หรือเป็นการเลื่อนไป 1 ตำแหน่งจากตำแหน่งเดิม (Shiftment, n=1)

เป็นอย่างไรกันบ้าง สำหรับการเข้ารหัสแบบ Caesar Cipher ที่เรานำมาเล่ากันใน EP นี้

อันที่จริงแล้วเราไม่อาจทราบได้แน่ชัดว่าการเข้ารหัสแบบ Caesar Cipher ในขณะนั้นมีประสิทธิภาพมากน้อยเพียงใด เนื่องจากฝ่ายศัตรูของ จูเลียส ซีซาร์ นั้นไม่รู้หนังสือ และแม้ว่าจะมีคนที่รู้หนังสือ ก็จะสันนิษฐานว่าข้อความเหล่านั้นเขียนด้วยภาษาต่างประเทศที่พวกเขาไม่รู้จัก ส่วนในด้านอื่น ๆ ที่น่าสนใจ ก็คือนอกเหนือการใช้ในสนามรบแล้ว การเข้ารหัสแบบ Caesar Cipher ยังเคยถูกคู่รักคู่หนึ่งใช้เพื่อเข้ารหัสข้อความบนหนังสือพิมพ์ The Times เพื่อส่งข้อความหากันอีกด้วย และยังมีเหตุการณ์ที่ Rajib Karim ถูกตัดสินลงโทษในสหราชอาณาจักรใน “ความผิดฐานก่อการร้าย” หลังจากเขาใช้รหัสซีซาร์ เพื่อสื่อสารกับนักเคลื่อนไหวอิสลาม ชาวบังกลาเทศ เพื่อพูดคุยถึงแผนการที่จะระเบิดเครื่องบินบริติชแอร์เวย์หรือรบกวนเครือข่ายอินเทอร์เน็ตของพวกเขา จนในปัจจุบันนี้ Caesar Cipher ยังถูกนำมาทำเป็นของเล่นสำหรับเด็ก เช่น วงแหวนถอดรหัสลับ (Secret Decoder Rings) เป็นต้น

References

> **[Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher)**
>
> In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspon...

---

<div class="post-metadata">

**Author:** ![supanut](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/supanut/32/22_2.png) [@supanut](https://discuss.hashpire.io/u/supanut)\
**Post date:** [July 17, 2022, 1:44pm UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/2 "2022-07-17T13:44:31Z")

</div>

- หัวข้อน่าจะเล่นอะไรให้ดึงดูดได้มากกว่านี้เช่น “Julius Caesar รัฐบุรุษผู้คิดค้นการเข้ารหัสแห่งจักรวรรดิโรมัน” ไรงี้
- อยากให้ช่วงต้นเขียนดึงดูดมากกว่านี้ เช่น หลายคนคงเคยได้ยินประวัติของ Julius Caesar ด้านการเมือง บทประพันธ์ และการทหาร แต่อีกมุมท่านยังเป็นผู้คิดค้นการเข้ารหัสด้วยนะ ไรงี้…
- อาจจะมีเล่นมุขขึ้นภาพซีซ่าสลัด!! เห้ยไม่ใช่ ไรงี้ 555

@Namtan@Pantitas

---

<div class="post-metadata">

**Author:** ![parinyar](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/parinyar/32/127_2.png) [@parinyar](https://discuss.hashpire.io/u/parinyar)\
**Post date:** [July 20, 2022, 6:29am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/3 "2022-07-20T06:29:38Z")

</div>

> [@Namtan](#):
>
> เอเชียน้อย

มันคือที่เดียวกันกับ อนาโตเลีย ปะครับ ถ้าใช่ผมว่าเปลี่ยนเป็นคำว่า อนาโตเลีย น่าจะดูเท่กว่านะครับ ^^

---

<div class="post-metadata">

**Author:** ![Namtan](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/namtan/32/23_2.png) [@Namtan](https://discuss.hashpire.io/u/Namtan)\
**Post date:** [July 20, 2022, 6:46am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/4 "2022-07-20T06:46:40Z")

</div>

ใช่ ๆ มันคือที่เดียวกันจ้า

---

<div class="post-metadata">

**Author:** ![anakornk](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/anakornk/32/3_2.png) [@anakornk](https://discuss.hashpire.io/u/anakornk)\
**Post date:** [August 8, 2022, 7:14am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/5 "2022-08-08T07:14:26Z")

</div>

> [@Namtan](#):
>
> คิดค้นขึ้น

ไม่รุ้ใช้เขาคิดค้นรึเปล่า แต่เขาใช้  
และเท่าที่ถูก recorded มา ใช้เป็นคนแรก

> Caesar’s was the first recorded use of this scheme

แนะนำให้เอาส่วนของ History and Usage เข้ามาใส่ จากลิ้งนี้ : [Caesar cipher - Wikipedia](https://en.wikipedia.org/wiki/Caesar_cipher)  
มีหลายอย่างน่าสนใจมาก  
เช่น

- Julius Caesar ใช้ Shift of Three ในการส่ง
- Augustus ใช้ right shift of one
- A Caesar cipher with a shift of one is used on the back of the [mezuzah](https://en.wikipedia.org/wiki/Mezuzah) to encrypt the [names of God](https://en.wikipedia.org/wiki/Names_of_God_in_Judaism).
- the personal advertisements section in newspapers would sometimes be used to exchange messages encrypted using simple cipher schemes. [Kahn](https://en.wikipedia.org/wiki/David_Kahn_(writer)) (1967) describes instances of lovers engaging in secret communications enciphered using the Caesar cipher in _[The Times](https://en.wikipedia.org/wiki/The_Times)_ . (การใช้งานในหนังสือพิม The Times อาจจะไปลองหาดู และ decrypt เล่น)
- Caesar ciphers can be found today in children’s toys such as [secret decoder rings](https://en.wikipedia.org/wiki/Secret_decoder_ring).
- In 2011, Rajib Karim was convicted in the United Kingdom of “terrorism offences” after using the Caesar cipher to communicate with Bangladeshi Islamic activists discussing plots to blow up [British Airways](https://en.wikipedia.org/wiki/British_Airways) planes or disrupt their IT networks

ส่วน Pros and Cons คิดว่าเนื้อหาไม่ค่อยโอเค  
Pros มันไม่ใช่ Pros สักเท่าไร คือการเข้ารหัส คือต้องการทำให้ยุ่งยาก ? ถ้าไม่ยุ่งยากมันก็ไม่ปลอดภัย

พวก Key, Keyspace พวกนี้ cover ยัง เอาจริงๆคนส่วนใหญ่อ่านอาจจะไม่รู้ด้วยซ้ำว่าคีย์คืออะไร

Plus, น่าจะ 0 ถึง 25 ปะ ? 26 คือการไม่ขยับ คือ 0

---

<div class="post-metadata">

**Author:** ![anakornk](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/anakornk/32/3_2.png) [@anakornk](https://discuss.hashpire.io/u/anakornk)\
**Post date:** [August 8, 2022, 7:18am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/6 "2022-08-08T07:18:36Z")

</div>

Plus, เนื่องจากมัน Circular, สามารถหา left shift ซึ่งเท่ากับ right shift ได้

---

<div class="post-metadata">

**Author:** ![supanut](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/supanut/32/22_2.png) [@supanut](https://discuss.hashpire.io/u/supanut)\
**Post date:** [October 10, 2022, 1:13pm UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/7 "2022-10-10T13:13:22Z")

</div>

@Namtan พี่อ่านภาพรวมแล้วโอเคนะครับ

@Pantitas

- ภาพกราฟฟิกอาจจะต้องมีแก้เรื่องซีซ่าร์อาจจะไม่ใช่คนคิดการเข้ารหัสนี้ตามที่ @anakornk แจ้งไว้ แต่ให้เสนอว่าเป็นผู้ใช้งานการเข้ารหัสแบบนี้จนการเข้ารหัสนี้ถูกขนานนามว่า Caesar Cipher ไรงี้ดีกว่าไหมครับ
- อยากให้มีภาพกราฟฟิก ที่เหมือนรวมๆ หลายๆ เรื่องราวตามพารากราฟนี้ด้วยดีไหมครับ

> [@Namtan](#):
>
> ส่วนในด้านอื่น ๆ ที่น่าสนใจ ก็คือนอกเหนือการใช้ในสนามรบแล้ว การเข้ารหัสแบบ Caesar Cipher ยังเคยถูกคู่รักคู่หนึ่งใช้เพื่อเข้ารหัสข้อความบนหนังสือพิมพ์ The Times เพื่อส่งข้อความหากันอีกด้วย และยังมีเหตุการณ์ที่ Rajib Karim ถูกตัดสินลงโทษในสหราชอาณาจักรใน “ความผิดฐานก่อการร้าย” หลังจากเขาใช้รหัสซีซาร์ เพื่อสื่อสารกับนักเคลื่อนไหวอิสลาม ชาวบังกลาเทศ เพื่อพูดคุยถึงแผนการที่จะระเบิดเครื่องบินบริติชแอร์เวย์หรือรบกวนเครือข่ายอินเทอร์เน็ตของพวกเขา จนในปัจจุบันนี้ Caesar Cipher ยังถูกนำมาทำเป็นของเล่นสำหรับเด็ก เช่น วงแหวนถอดรหัสลับ (Secret Decoder Rings) เป็นต้น

---

<div class="post-metadata">

**Author:** ![supanut](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/supanut/32/22_2.png) [@supanut](https://discuss.hashpire.io/u/supanut)\
**Post date:** [October 17, 2022, 10:18am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/8 "2022-10-17T10:18:16Z")

</div>

@Pantitas

1. ภาพที่ 3/6 เราเหมือนพยายามหลีกลี่ยงการพูดว่าการเข้ารหัสนี้ถูกคิดค้นโดย Julius Caesar แต่ภาพนี้น่าจะบอกตรงๆ เลย อันนี้ลองปรับหาคำใหม่ดีไหมครับ ตอนนั้นเหมือน @anakornk แจ้งว่าเราไม่รู้จริงๆ ว่าเค้าสร้างจริงไหม 🙂
2. ภาพที่ 5/6 เหมือนจะเป็นคนละเรื่องกัน แต่อ่านทีแรกคิดว่าเรื่องต่อกันซะอีก ลองหาวิธีทำให้คนไม่คิดว่ามันเป็นเรื่องต่อกัน (อ่านทีแรกคิดว่าคนละพารากราฟเฉยๆ 555)

---

<div class="post-metadata">

**Author:** ![anakornk](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/anakornk/32/3_2.png) [@anakornk](https://discuss.hashpire.io/u/anakornk)\
**Post date:** [October 19, 2022, 2:07am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/9 "2022-10-19T02:07:10Z")

</div>

@Namtan @Pantitas Concern หลัก

- Caesar ใช้คนคิดค้นไม่ อันนี้ไม่รู้ (บนรูปมีเขียน)
- มันน่าจะต้องระบุ Direction ของ Shift ด้วยรึเปล่า Left Shift or Right Shift
- รูปที่ 5 ถ้าโชตัวอย่างให้น่าสนใจกว่านี้น่าจะดีนะ อาจจะ เพิ่มสองรูปก็ได้ ให้มันเห็นภาพ the times หรืออะไรงี้ รู้สึคมัน text-based เกินไปดูไม่น่าจูงใจ

---

<div class="post-metadata">

**Author:** ![Namtan](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/namtan/32/23_2.png) [@Namtan](https://discuss.hashpire.io/u/Namtan)\
**Post date:** [October 19, 2022, 8:37am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/10 "2022-10-19T08:37:23Z")

</div>

> [@Namtan](#):
>
> หากเราทดลองเข้ารหัสแบบ Caesar Cipher Left Shift of 3 (เลื่อนทางซ้าย 3 ตำแหน่ง) จากคำว่า “HASHPIRE” จะเข้ารหัสได้เป็น “KDVKSLUH”

อันนี้ใส่เพิ่มไปแล้วค่ะ

---

<div class="post-metadata">

**Author:** ![supanut](https://discuss.hashpire.io/user_avatar/discuss.hashpire.io/supanut/32/22_2.png) [@supanut](https://discuss.hashpire.io/u/supanut)\
**Post date:** [October 25, 2022, 5:45am UTC](https://discuss.hashpire.io/t/ep-12-caesar-cipher/281/11 "2022-10-25T05:45:06Z")

</div>

@Pantitas

- ภาพที่ 3/7 หัวข้อผิดนะครับ Caesar Cipher ไม่ใช่คน 555
- อื่นๆ ดูโอเคมากๆ ตัวอย่างการใช้ Caesar Cipher พอมีภาพประกอบแล้วน่าสนใจมากครับ
