fbpx
วิกิพีเดีย

Mcrypt

"mcrypt" เป็นชุดคำสั่งที่ช่วยในการเข้ารหัสข้อมูลบนระบบปฏิบัติการยูนิกซ์ ซึ่งนำมาแทนที่แพคเกจ crypt () และคำสั่ง crypt (1) เดิม ภายใต้ลิขสิทธิ์ GNU General Public License โดยมีฟังก์ชันและกระบวนการการเข้ารหัสสมัยใหม่แบบต่างๆ ด้วยรูปแบบคำสั่งที่ง่าย ผู้ใช้งานที่เป็น end-user สามารถที่จะเข้าใจ และใช้งาน MCrypt ได้โดยไม่ต้องมีความรู้ทางการเข้ารหัสมากนัก องค์ประกอบที่สำคัญอย่างหนึ่งของ MCrypt คือ libmcrypt ซึ่งเป็น library การเข้ารหัสที่ Mcrypt ใช้ ขั้นตอนวิธีของการเข้ารหัสข้อมูลทั้งหมดที่ MCrypt รองรับ จึงขึ้นอยู่กับ library ตัวนี้ ส่วนโหมดของ Block algorithm ที่ MCrypt ใช้ คือ ECB CBC CFB OFB และ nOFB เมื่อ MCrypt ทำการเข้ารหัส หรือถอดรหัสแฟ้มข้อมูล MCrypt จะทำการสร้างแฟ้มข้อมูลขึ้นมาใหม่โดยมี extenion เป็น .nc และมี โหมด 0600 ซึ่งจะเก็บวันที่ของการเปลี่ยนแปลงแฟ้มข้อมูลเดิม (ซึงอาจสั่งให้โปรแกรมลบทิ้งได้ โดยใช้ -u parameter)

การใช้งาน MCrypt

โดยปกติ เมื่อเลือกขั้นตอนวิธีการเข้ารหัสแล้ว โปรแกรมจะเรียกหา passphase ซึ่งเราสามารถใส่ได้ไม่เกิน 512 ตัวอักษร ซึ่งโปรแกรมจะนำ passphase นี้ไปสร้าง key ขึ้น โดยใช้ขั้นตอนวิธีการสร้าง key ที่อยู่ในตัวโปรแกรม จากนั้นจึงส่งค่าต่างๆให้กับขั้นตอนวิธีการเข้ารหัสที่เลือก ส่วนในการใช้งานทีดีนั้น ผู้ใช้ควรจะเลือกใช้ขั้นตอนวิธีที่เหมาะสมกับข้อมูลที่จะเข้ารหัส ควรจะบีบอัดข้อมูลก่อนทำการเข้ารหัส ซึ่งจะช่วยลดการซ้ำซ้อนของข้อมูล (การเข้ารหัสข้อความที่มีอักขระเหมือนกันมากๆ จะทำให้เสี่ยงต่อการถูกถอดรหัสข้อมูลโดยการวิเคราะห์ pattern) และทำให้การเข้ารหัสนั้นเร็วขึ้น

Block algorithm ที่ใช้ใน MCrypt

ECB หรือ Electronic CodeBook เป็นโหมดพื้นฐานที่สุด โหมดนี้จะเข้ารหัสข้อมูลในแต่ละ block แบบอิสระต่อกัน CBC หรือ Cipher Block Chaining จะดีกว่า ECB ตรงที่ข้อความแต่ละ block จะถูกนำมา XOR กับข้อความที่เข้ารหัสแล้วจาก block ก่อนหน้า (โดยที่ block แรกจะเป็น block ที่ถูกสุ่มมา ซึงจะทำให้การเข้ารหัสข้อความเดียวกัน ไม่จำเป็นต้องได้ข้อความที่เข้ารหัสแล้เหมือนกัน) CFB หรือ Cipher-Feedback (in 8bit). เป็นขั้นตอนวิธีที่ใช้ข้อความที่เข้ารหัสแล้ว และ key มาเป็นองค์ประกอบในการสร้างชุดอัขระที่จะในไป XOR กับข้อความที่ต้องการเข้ารหัส ซ้ำๆ ไปจนได้ข้อความที่เข้ารหัสแล้ว OFB หรือ Output-Feedback (in 8bit). นิยมใช้กับข้อมูลที่มีการรบกวน (ข้อมูลที่อาจจะเสียหาย หรือไม่สมบูรณ์) ซึ่งส่วนที่มีการรบกวนจะไม่สร้างความเสียหายกับส่วนอื่นๆ ในการเข้ารหัส และถอดรหัสเพราะข้อความที่ถูกเข้ารหัสจาก block นั้นๆ จะไม่นำมาใช้เป็นตัวตั้งต้นของการเข้ารหัสใน block อื่นๆ nOFB หรือ Output-Feedback (in nbit). เช่นเดียวกับ OFB (in 8bit) แต่มีการเปลี่ยนแปลงขนาดของ block โดยที่ n คือขนาดของ block ที่จะใช้ในขั้นตอนวิธี

ตัวอย่างการใช้งาน

เข้ารหัสไฟล์ชื่อ data.txt :

 $ mcrypt data.txt 

Output:

 Enter the passphrase (maximum of 512 characters) Please use a combination of upper and lower case letters and numbers. Enter passphrase: พิมพ์ passphrase ที่ต้องการ Enter passphrase: พิมพ์ passphrase อีกครั้ง 


ไฟล์ที่เข้ารหัสแล้วจะมีนามสกุลเป็น .nc :

 $ ls data.txt.nc $ cat data.txt.nc 


ถอดรหัสไฟล์ชื่อ data.txt.nc :

 $ mcrypt -d data.txt.nc 

Output:

 Enter passphrase: File data.txt.nc was decrypted. 


ตรวจสอบดูไฟล์ที่ถูกถอดรหัสแล้ว:

 $ ls data.txt $ cat data.txt 


ลบ input file หากกระบวนการเสร็จสมบูรณ์ (ใช้ -u option) :

 $ mcrypt -u data.txt 

หรือ

 $ mcrypt -u -d data.txt.nc 


อ้างอิง

mcrypt, บทความน, หร, อส, วนน, ของบทความต, องการปร, บร, ปแบบ, งอาจหมายถ, องการจ, ดร, ปแบบข, อความ, ดหน, แบ, งห, วข, ดล, งก, ภายใน, และ, หร, อการจ, ดระเบ, ยบอ, ณสามารถช, วยแก, ไขป, ญหาน, ได, โดยการกดท, แก, ไข, านบน, จากน, นปร, บปร, งหร, อจ, ดร, ปแบบอ, ในบทความให. bthkhwamnihruxswnnikhxngbthkhwamtxngkarprbrupaebb sungxachmaythung txngkarcdrupaebbkhxkhwam cdhna aebnghwkhx cdlingkphayin aela hruxkarcdraebiybxun khunsamarthchwyaekikhpyhaniidodykarkdthipum aekikh danbn caknnprbprunghruxcdrupaebbxun inbthkhwamihehmaasmbthkhwamnimichuxepnphasaxngkvs enuxngcakyngimmichuxphasaithythikrachb ehmaasm impraktkhaxanthiaenchd hruximpraktkhaaeplthiichinthangwichakar mcrypt epnchudkhasngthichwyinkarekharhskhxmulbnrabbptibtikaryuniks sungnamaaethnthiaephkhekc crypt aelakhasng crypt 1 edim phayitlikhsiththi GNU General Public License odymifngkchnaelakrabwnkarkarekharhssmyihmaebbtang dwyrupaebbkhasngthingay phuichnganthiepn end user samarththicaekhaic aelaichngan MCrypt idodyimtxngmikhwamruthangkarekharhsmaknk xngkhprakxbthisakhyxyanghnungkhxng MCrypt khux libmcrypt sungepn library karekharhsthi Mcrypt ich khntxnwithikhxngkarekharhskhxmulthnghmdthi MCrypt rxngrb cungkhunxyukb library twni swnohmdkhxng Block algorithm thi MCrypt ich khux ECB CBC CFB OFB aela nOFB emux MCrypt thakarekharhs hruxthxdrhsaefmkhxmul MCrypt cathakarsrangaefmkhxmulkhunmaihmodymi extenion epn nc aelami ohmd 0600 sungcaekbwnthikhxngkarepliynaeplngaefmkhxmuledim sungxacsngihopraekrmlbthingid odyich u parameter enuxha 1 karichngan MCrypt 2 Block algorithm thiichin MCrypt 3 twxyangkarichngan 4 xangxingkarichngan MCrypt aekikhodypkti emuxeluxkkhntxnwithikarekharhsaelw opraekrmcaeriykha passphase sungerasamarthisidimekin 512 twxksr sungopraekrmcana passphase niipsrang key khun odyichkhntxnwithikarsrang key thixyuintwopraekrm caknncungsngkhatangihkbkhntxnwithikarekharhsthieluxk swninkarichnganthidinn phuichkhwrcaeluxkichkhntxnwithithiehmaasmkbkhxmulthicaekharhs khwrcabibxdkhxmulkxnthakarekharhs sungcachwyldkarsasxnkhxngkhxmul karekharhskhxkhwamthimixkkhraehmuxnknmak cathaihesiyngtxkarthukthxdrhskhxmulodykarwiekhraah pattern aelathaihkarekharhsnnerwkhunBlock algorithm thiichin MCrypt aekikhECB hrux Electronic CodeBook epnohmdphunthanthisud ohmdnicaekharhskhxmulinaetla block aebbxisratxkn CBC hrux Cipher Block Chaining cadikwa ECB trngthikhxkhwamaetla block cathuknama XOR kbkhxkhwamthiekharhsaelwcak block kxnhna odythi block aerkcaepn block thithuksumma sungcathaihkarekharhskhxkhwamediywkn imcaepntxngidkhxkhwamthiekharhsaelehmuxnkn CFB hrux Cipher Feedback in 8bit epnkhntxnwithithiichkhxkhwamthiekharhsaelw aela key maepnxngkhprakxbinkarsrangchudxkhrathicainip XOR kbkhxkhwamthitxngkarekharhs sa ipcnidkhxkhwamthiekharhsaelw OFB hrux Output Feedback in 8bit niymichkbkhxmulthimikarrbkwn khxmulthixaccaesiyhay hruximsmburn sungswnthimikarrbkwncaimsrangkhwamesiyhaykbswnxun inkarekharhs aelathxdrhsephraakhxkhwamthithukekharhscak block nn caimnamaichepntwtngtnkhxngkarekharhsin block xun nOFB hrux Output Feedback in nbit echnediywkb OFB in 8bit aetmikarepliynaeplngkhnadkhxng block odythi n khuxkhnadkhxng block thicaichinkhntxnwithitwxyangkarichngan aekikhekharhsiflchux data txt mcrypt data txt Output Enter the passphrase maximum of 512 characters Please use a combination of upper and lower case letters and numbers Enter passphrase phimph passphrase thitxngkar Enter passphrase phimph passphrase xikkhrng iflthiekharhsaelwcaminamskulepn nc ls data txt nc cat data txt nc thxdrhsiflchux data txt nc mcrypt d data txt nc Output Enter passphrase File data txt nc was decrypted trwcsxbduiflthithukthxdrhsaelw ls data txt cat data txt lb input file hakkrabwnkaresrcsmburn ich u option mcrypt u data txt hrux mcrypt u d data txt ncxangxing aekikhhttp ific uv es informatica manuales php ref mcrypt html http freeware sgi com Installable mcrypt 2 6 3 html http www peachpit com articles article aspx p 711187 amp seqNum 5 amp rl 1 http mcrypt hellug gr http www cyberciti biz tips linux or unix password protecting files htmlekhathungcak https th wikipedia org w index php title Mcrypt amp oldid 4697079, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม