# Block Cipher คืออะไร

**URL:** <https://discuss.hashpire.io/t/block-cipher/382>\
**Category:** Content Board\
**Tags:** beginner, article\
**Created:** [August 25, 2022, 7:06am UTC](https://discuss.hashpire.io/t/block-cipher/382 "2022-08-25T07:06:31Z")\
**Posts on this page:** 8\
**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:** [August 25, 2022, 7:06am UTC](https://discuss.hashpire.io/t/block-cipher/382/1 "2022-08-25T07:06:31Z")

</div>

# Planning

* * *

## Outline-text

### ชื่อหัวข้อที่จะนำเสนอ

- Block Cipher คืออะไร

### โครงสร้างของเนื้อหา

1. จำนวนหัวข้อทั้งหมดที่จะนำเสนอ
  - 3 หัวข้อ

2. แต่ละหัวข้อจะนำเสนออะไร
  - หัวข้อที่ 1 : อธิบายความหมายของ Block Cipher
  - หัวข้อที่ 2 : อธิบายกระบวนการทำงานของ Block Cipher การ Padding และยกตัวอย่างประกอบ
  - หัวข้อที่ 3 : ตัวอย่าง Block Cipher เช่น Data Encryption Standard (DES)
  - Reference : จากที่เรียนกันภายใน และจาก link : [Block Cipher](https://www.tutorialspoint.com/cryptography/block_cipher.htm)

### ประเด็นสำคัญของบทความ

- อธิบายเกี่ยวกับ Block Cipher ที่เชื่อมโยงมาจาก Symmetric - Key Cryptography

### สิ่งที่ผู้อ่านจะได้รับจากบทความ

- เข้าใจหลักการทำงานของ Block Cipher ในเบื้องต้น

* * *

## Outline-graphic

### รูปแบบของกราฟฟิค + โครงสร้าง

- 

* * *

คำถามที่รบกวนให้ Reviewer ช่วยตอบค่ะ

#### 1. ต้องการรู้ประเด็นไหนเพิ่มเติมไหม เพราะอะไร

#### 2. คิดว่าเรียงลำดับการนำเสนอได้ดีรึยัง ถ้าไม่ดี มีไอเดียอย่างไร

#### 3. มีประเด็นไหนควรตัดทิ้งไหม เพราะอะไร

* * *

# 📝 Content text + graphic

 ![Block-Cipher-1](https://discuss.hashpire.io/uploads/default/original/2X/3/33cfc516b30e447cae6faeb8016729848068a9ef.png)

 ![Block-Cipher-2](https://discuss.hashpire.io/uploads/default/original/2X/1/1393ddf896fa6243854ad1322da34c3b150c1e34.png)

 ![Block-Cipher-3](https://discuss.hashpire.io/uploads/default/original/2X/4/495dc26bd22e779c7544b2f6d0866af0f928e259.png)

 ![Block-Cipher-4](https://discuss.hashpire.io/uploads/default/original/2X/c/cd484bbe75aafc90273bfca4d25442e74f3b3baa.png)

 ![Block-Cipher-5](https://discuss.hashpire.io/uploads/default/original/2X/b/b652e633154cfa0051bef68b89acb35ac3678f60.png)

 ![Block-Cipher-6](https://discuss.hashpire.io/uploads/default/original/2X/7/728b49e8c4ada704f72eb60e1126a4ef0082c607.png)

 ![Block-Cipher-7](https://discuss.hashpire.io/uploads/default/original/2X/8/8d9b899bba1b208d713966e1880a6dfcf8a9b249.png)

Block Cipher

คือการเข้ารหัสแบบ Symmetric - Key Cryptography ที่มีรูปแบบการเข้ารหัสเป็น Block ซึ่งขนาดบล็อกปกติคือ 64 บิต 128 บิตและ 256 บิต ขนาดบล็อกที่ทำการเข้ารหัสแล้วจะมีขนาดคงที่

 ![Block Cipher](https://discuss.hashpire.io/uploads/default/original/1X/7824235c90e26d64d7a07ddf073493642089ca42.png)

 ![Block Cipher-2](https://discuss.hashpire.io/uploads/default/original/1X/b5228894da3beeb6337c0a1b2e986ab43ab9cdfc.png)

กระบวนการทำงาน โดยปกติแล้วข้อความที่นำมาเข้ากระบวนการ Block Cipher จะมีขนาดความยาวไม่พอดีกับขนาดความยาวของบล็อก ดังนั้นในกรณีนี้จึงมีกระบวนการที่เรียกว่า “Padding” ซึ่งเป็นการเพิ่มความยาวของข้อความธรรมดาให้พอดีกับขนาดของบล็อก โดยการเพิ่มค่าเริ่มต้น (Default Value) เช่น 0 เป็นต้น

เช่น หากเรามีข้อความขนาดความยาว 150 บิต ใช้บล็อกที่มีขนาด 64 บิต จำนวน 2 บล็อก จะได้ 128 ซึ่งจะเหลืออีก 22 บิต ที่ยังไม่มีบล็อก เราจะต้องทำการเพิ่มบล็อกขนาด 64 บิต เข้าไปอีก 1 บล็อก รวมเป็น 3 บล็อก ทำให้ขนาดของบล็อกใหญ่กว่าขนาดของข้อความ แต่โดยปกติขนาดบล็อกกับข้อมูลจะต้องเท่ากัน ดังนั้น เราจึงต้องทำการ Padding เข้าไปอีก 42 บิต (64-22=42) ในบล็อกสุดท้ายเพื่อให้ได้ 64 บิต พอดีกับขนาดของบล็อก และสามารถทำการเข้ารหัสต่อไปได้  
ตัวอย่าง Block Cipher เช่น Data Encryption Standard (DES) เป็นต้น

> **[Block Cipher.pptx](https://docs.google.com/presentation/d/1Z9aeiYaXomhhvw_gZWulMbxUt3MpP-DW/edit?usp=sharing&ouid=104869847661401464704&rtpof=true&sd=true)**
>
> Block Cipher \>\> Block Cipher คืออะไร คือ การเข้ารหัสแบบ Symmetric - Key Cryptography ที่มีรูปแบบการเข้ารหัสเป็นบล็อก (Block) ขนาดบล็อกที่ใช้งานจะมีหลายขนาด เช่น 64 ,128 หรือ 256 บิต เป็นต้น และขนาดของบล็อกที่ทำการเข้ารหัสแล้วจะมีขนาดคงที่

# Reference

- Link here…

---

<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:** [August 25, 2022, 8:27am UTC](https://discuss.hashpire.io/t/block-cipher/382/2 "2022-08-25T08:27:11Z")

</div>



---

<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:** [August 26, 2022, 9:28am UTC](https://discuss.hashpire.io/t/block-cipher/382/3 "2022-08-26T09:28:29Z")

</div>

คำถามที่รบกวนให้ Reviewer ช่วยตอบค่ะ

1. ขอ ref เพิ่มครับ
2. 
3.

---

<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:** [August 26, 2022, 10:28am UTC](https://discuss.hashpire.io/t/block-cipher/382/4 "2022-08-26T10:28:20Z")

</div>



---

<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:** [August 26, 2022, 10:28am UTC](https://discuss.hashpire.io/t/block-cipher/382/5 "2022-08-26T10:28:23Z")

</div>



---

<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:** [August 31, 2022, 4:57am UTC](https://discuss.hashpire.io/t/block-cipher/382/6 "2022-08-31T04:57:44Z")

</div>



---

<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 28, 2022, 7:39am UTC](https://discuss.hashpire.io/t/block-cipher/382/7 "2022-10-28T07:39:48Z")

</div>

@Namtan ระวังเรื่องการลงลึกมากเกิดไปนะครับตอนเขียนบทความ ยกตัวอย่างพอแต่ไม่ต้องอธิบายลงลึกครับ

---

<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:** [November 7, 2022, 11:18am UTC](https://discuss.hashpire.io/t/block-cipher/382/8 "2022-11-07T11:18:49Z")

</div>

@Namtan

> [@Namtan](#):
>
> เช่น หากเราใช้ข้อความธรรมดาที่มีความยาว 64 บิต เป็น input ข้อความเข้ารหัสหรือ Output ที่ได้จะเป็น 64 บิต เช่นกัน

- ไม่เข้าใจว่าตัวอย่างนี้ยกขึ้นมาเพื่อเสริมความเข้าใจเรื่องอะไร พี่อ่านแล้วไม่ get ว่าอยากจะสื่อสารอะไร ลองเปลี่ยนเป็น input 128 output จะได้เท่าไหร่ ? (2 block, block ละ 64?)
- ซึ่งถ้าตัวอย่างนี้ไปซ้ำซ้อนกับข้างล่างที่จะอธิบายก็ตัดส่วนนี้ทิ้งได้เลยนะครับ
- อื่นๆ อ่านแล้วโอเคแล้วครับ ถ้าแก้แล้วถือว่า CF ครับสามารถขึ้น Artwork ได้เลย
