-
-
[原创]初入好望角WriteUp
-
发表于: 2019-3-22 22:11 2821
-
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
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
他的文章
- [原创]初入好望角WriteUp 2822
- [原创]流浪者WriteUp 2951
- [原创]看雪CTF.TSRC 2018 团队赛 - 半加器Writeup 2761
- [原创]看雪CTF.TSRC 2018 团队赛 - 初世纪 2003
- [原创]第十五题 智能设备WriteUp 6557
看原图
赞赏
雪币:
留言: