Esempio n. 1
0
        //private log4net.ILog _log = log4net.LogManager.GetLogger("PassWordBooks");
        public MainWindow()
        {
            InitializeComponent();
            string str = "{'张志超':'你妈妈','data':[{},{}]}", key = "04551df76713561574a6183f050503bd", re = string.Empty, re1 = string.Empty;

            EncryptAndDecodeServer.IEncryptAndDecodeServer i = new EncryptAndDecodeServer.EncryptAndDecodeServer();
            re  = i.AesEncryption(str, key);
            re1 = i.AesDecryption(re, key);
        }
Esempio n. 2
0
        public void SavePhysicsKey(string fileDir, string passWordSecurity, string secondPassWord, string target)
        {
            EncryptAndDecodeServer.IEncryptAndDecodeServer server = new EncryptAndDecodeServer.EncryptAndDecodeServer();
            string physiceStr = server.AesEncryption(secondPassWord, passWordSecurity);
            string filePath   = string.Format(@"{0}/{1}_{2}.db", fileDir.TrimEnd('/'), target, DateTime.Now.ToString("yyyyMMddhhmmss"));

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(filePath))
            {
                sw.WriteLine(physiceStr);
            }
        }