แพคเกจ Python ที่ใช้งานง่ายสำหรับการนำไปใช้และทดลองกับอัลกอริทึมการเข้ารหัส DES ที่มีชื่อเสียง มันใช้ทั้งแบบคลาสสิก (การตั้งค่าเริ่มต้นจากคำอธิบายตำราเรียนของ DES) และ DES ที่ไม่ใช่แบบคลาสสิก ตรวจสอบแอป DES สำหรับการใช้งานที่เฉพาะเจาะจงมากแสดงให้เห็นถึงเอฟเฟกต์หิมะถล่มและปุ่มอ่อนแอโดยใช้แพ็คเกจ
มีแพ็คเกจ DES ค่อนข้างน้อยสำหรับ Python แต่ไม่มีใครให้ความยืดหยุ่นสูงเช่นนี้ในการใช้ DES รุ่นที่ไม่ใช่แบบคลาสสิก แพ็คเกจนี้มีวัตถุประสงค์โดยเฉพาะเพื่อทดสอบกับ hyperparamters ที่แตกต่างกันซึ่งสามารถปรับแต่งได้ในขณะที่ใช้ DES
help(<function_name>) ในล่าม Pythonโบนัส : แพ็คเกจนี้สามารถช่วยชีวิตสำหรับหลักสูตรความปลอดภัยเครือข่าย CSE 537- สอนที่ IIT (BHU)
*การปรับแต่งสิ่งเหล่านี้อาจต้องเปลี่ยนซอร์สโค้ด ณ รีลีสปัจจุบัน
รันคำสั่งต่อไปนี้ในพรอมต์เทอร์มินัล/คำสั่งของคุณ-
$ pip install DESfiddle
หมายเหตุ : หากคุณไม่ได้ติดตั้ง
pipให้ทำตามขั้นตอนเหล่านี้
# Importing
import DESfiddle.utils as dfu
# Usage
permutation_arr = dfu.generate_permutation(64)
# Importing
from DESfiddle.utils import *
# or just specify the function name you wanna import
# Usage
permutation_arr = generate_permutation(64)
from DESfiddle.utils import *
# Inputs in binary setting
plaintext = "0101010101010101010101010101010101010101010101010101010101010101"
key = "1111111111111111111111111111111100000000000000000000000000000000"
# Settings
nor = 16
halfwidth = 32
hamming_dist = 1
# Hamming the plaintext in binary mode
ref_pt_arr = preprocess_plaintext(plaintext, halfwidth)
pt_arr = preprocess_plaintext(plaintext, halfwidth, hamming_dist)
key = preprocess_key(key, halfwidth)
rkb,rkh = generate_round_keys(key,nor, halfwidth)
ref_ciphertext, ref_round_ciphertexts = encrypt(ref_pt_arr, rkb, nor, halfwidth)
_, round_ciphertexts = encrypt(pt_arr, rkb, nor, halfwidth)
diff = calc_diff(ref_round_ciphertexts, round_ciphertexts)
# Hamming the key in binary mode
pt_arr = preprocess_plaintext(plaintext, halfwidth)
ref_key = preprocess_key(key,halfwidth)
key = preprocess_key(key, halfwidth, hamming_dist)
ref_rkb, ref_rkh = generate_round_keys(ref_key, nor, halfwidth)
rkb,_ = generate_round_keys(key, nor, halfwidth)
ref_ciphertext, ref_round_ciphertexts = encrypt(pt_arr, ref_rkb, nor, halfwidth)
_, round_ciphertexts = encrypt(pt_arr, rkb, nor, halfwidth)
diff = calc_diff(ref_round_ciphertexts, round_ciphertexts)
from DESfiddle.utils import *
# Inputs in ASCII setting
plaintext = "This is so cool"
key = "Yesss"
# Settings
nor = 16
halfwidth = 32
hamming_dist = 1
# Preprocessing when input in ASCII
plaintext = txt_to_hex(plaintext)
plaintext = hex_to_bin(plaintext)
key = txt_to_hex(key)
key = hex_to_bin(key)
# Hamming the plaintext in binary mode
ref_pt_arr = preprocess_plaintext(plaintext, halfwidth)
pt_arr = preprocess_plaintext(plaintext, halfwidth, hamming_dist)
key = preprocess_key(key, halfwidth)
rkb,rkh = generate_round_keys(key,nor, halfwidth)
ref_ciphertext, ref_round_ciphertexts = encrypt(ref_pt_arr, rkb, nor, halfwidth)
_, round_ciphertexts = encrypt(pt_arr, rkb, nor, halfwidth)
diff = calc_diff(ref_round_ciphertexts, round_ciphertexts)
# Hamming the key in binary mode
pt_arr = preprocess_plaintext(plaintext, halfwidth)
ref_key = preprocess_key(key,halfwidth)
key = preprocess_key(key, halfwidth, hamming_dist)
ref_rkb, ref_rkh = generate_round_keys(ref_key, nor, halfwidth)
rkb,_ = generate_round_keys(key, nor, halfwidth)
ref_ciphertext, ref_round_ciphertexts = encrypt(pt_arr, ref_rkb, nor, halfwidth)
_, round_ciphertexts = encrypt(pt_arr, rkb, nor, halfwidth)
diff = calc_diff(ref_round_ciphertexts, round_ciphertexts)
ขอบคุณที่สละเวลามีส่วนร่วม!
ต่อไปนี้เป็นชุดของแนวทางสำหรับการมีส่วนร่วมในการลดลง นี่เป็นเพียงแนวทางไม่ใช่กฎดังนั้นใช้การตัดสินที่ดีที่สุดของคุณและอย่าลังเลที่จะเสนอการเปลี่ยนแปลงเอกสารนี้ในคำขอดึง
Desfiddle ถูกสร้างขึ้นเหนือ Python ดังนั้นหากคุณยังใหม่กับ Python โปรดตรงไปที่เว็บไซต์ที่ยอดเยี่ยมนี้
ตรวจสอบให้แน่ใจว่าข้อผิดพลาดยังไม่ได้รายงานโดยการค้นหา GitHub ภายใต้ปัญหา หากคุณไม่สามารถหาปัญหาแบบเปิดที่ระบุถึงข้อผิดพลาดให้เปิดปัญหาใหม่
ข้อมูลรายละเอียดมีประโยชน์มากในการทำความเข้าใจปัญหาเช่น-
ยินดีต้อนรับคำขอดึงเสมอ
python -m unittest เพื่อทดสอบรหัสของคุณก่อนที่คุณ git commitดังต่อไปนี้ไวยากรณ์ VM.MP ครั้งแรกเป็นวิชาเอกและหมายถึงการเปลี่ยนแปลงที่เข้ากันได้ ประการที่สองคือเล็กน้อยและหมายถึงการเปลี่ยนแปลงที่เข้ากันได้ย้อนหลัง ประการที่สามคือแพทช์และหมายถึงการเปลี่ยนแปลงที่เข้ากันได้ขนาดเล็ก
สถานที่ด้วยตนเองของแหล่งที่มาของความจริงสำหรับเวอร์ชันคือ at setup.py