-
-
[原创]初入好望角WriteUp
-
发表于: 2019-3-22 22:11 2830
-
using System.IO; using System; using System.Security.Cryptography; using System.Text; class Program { static void Main() { PasswordDeriveBytes pdb = new PasswordDeriveBytes("Kanxue2019", null); Byte[] Key = pdb.GetBytes(0x20); Encoding unicode = Encoding.UTF8; Byte[] IV = unicode.GetBytes("Kanxue2019CTF-Q1"); string plaintext = null; byte[] cipherText = Convert.FromBase64String("4RTlF9Ca2+oqExJwx68FiA=="); using (RijndaelManaged rijAlg = new RijndaelManaged()) { rijAlg.Key = Key; rijAlg.IV = IV; ICryptoTransform decryptor = rijAlg.CreateDecryptor(rijAlg.Key, rijAlg.IV); using (MemoryStream msDecrypt = new MemoryStream(cipherText)) { using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) { using (StreamReader srDecrypt = new StreamReader(csDecrypt)) { plaintext = srDecrypt.ReadToEnd(); } } } } Console.WriteLine(plaintext); } } 结果为:Kanxue2019Q1CTF
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
- [原创]初入好望角WriteUp 2831
- [原创]流浪者WriteUp 2962
- [原创]看雪CTF.TSRC 2018 团队赛 - 半加器Writeup 2775
- [原创]看雪CTF.TSRC 2018 团队赛 - 初世纪 2013
- [原创]第十五题 智能设备WriteUp 6573
看原图
赞赏
雪币:
留言: