Mavzu: des simmetrik kriptotizimi dasturiy modulini ishlab chiqish
Ishni bajarilish tartibi va qo’yilgan vazifa
Download 0.71 Mb.
|
3lab
- Bu sahifa navigatsiya:
- IKKITA BIR XIL ISH QABUL QILINMAYDI!!!!!
Ishni bajarilish tartibi va qo’yilgan vazifaAsosiy matn shifrlash usullaridan birida shifrlansin va qadamma – qadam izohlansin. Shuningdek, Delpi, Java, C++ va C# dasturlash tizimlaridan birida dasturiy ta’minot yaratilsin. TALABAGA TOPSHIRIQ!!!. Dasturiy ta’minotni ishlab chiqish va ushbu dastur talaba tomonidan ixtiyoriy dasturlash tili olinishi mumkin va hisobotda dasturiy ta’minot ishlashi to’liq tavsiflansin. IKKITA BIR XIL ISH QABUL QILINMAYDI!!!!! Men bu tajriba ishida C# dasturlash tilidan foydalanib, DES kriptotizimiga dastur tuzdim: Bu dasturning visual ko’rinishi: Shifrlash natijasi: Dastur kodi: DES shifri algoritmi (classi): using System; using System.Security.Cryptography; using System.IO; using System.Text; namespace CIPHERS { class des { public static string Encrypt_DES(string source, string key) { try
{ using (TripleDESCryptoServiceProvider tripleDESCryptoService = new TripleDESCryptoServiceProvider()) { using (MD5CryptoServiceProvider hashMD5Provider = new MD5CryptoServiceProvider()) { byte[] byteHash = hashMD5Provider.ComputeHash(Encoding.UTF8.GetBytes(key)); tripleDESCryptoService.Key = byteHash; tripleDESCryptoService.Mode = CipherMode.ECB;//CBC, CFB byte[] data = Encoding.Unicode.GetBytes(source); return Convert.ToBase64String(tripleDESCryptoService.CreateEncryptor().TransformFinalBlock(data, 0, data.Length)); } }
{ return "Xato"; } }
{ try
{ using (TripleDESCryptoServiceProvider tripleDESCryptoService = new TripleDESCryptoServiceProvider()) { using (MD5CryptoServiceProvider hashMD5Provider = new MD5CryptoServiceProvider()) { byte[] byteHash = hashMD5Provider.ComputeHash(Encoding.UTF8.GetBytes(key)); tripleDESCryptoService.Key = byteHash; tripleDESCryptoService.Mode = CipherMode.ECB;//CBC, CFB byte[] byteBuff = Convert.FromBase64String(encrypt); return Encoding.Unicode.GetString(tripleDESCryptoService.CreateDecryptor().TransformFinalBlock(byteBuff, 0, byteBuff.Length)); } }
{ return "xato"; } }
} Download 0.71 Mb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling