public void AddDataToDeDataList() { AllDenDatas = new List <DecryptData>(); Thread.Sleep(1000); int i = 1; HashHelper hashHelper = new HashHelper(); encryptViewModel.AllDecDatas = new ObservableCollection <DecryptData>(); if (this.encryptViewModel.AllDatas.Count >= this.encryptViewModel.AllDecDatas.Count) { foreach (var item in AllEnDatas) { if (this.encryptViewModel.AllDatas.Count > this.encryptViewModel.AllDecDatas.Count) { DecryptData decryptData = new DecryptData(); decryptData.No = i; ++i; decryptData.Text = hashHelper.GetHashOfString(item.Text); App.Current.Dispatcher.Invoke((Action) delegate // <--- HERE { encryptViewModel.AllDecDatas.Add(decryptData); }); Thread.Sleep(1000); } } } encryptViewModel.Thread2.Suspend(); }
public BmUdtEncryptedSocket(String encryptionKey) : base() { // assume aes encryption var aes = new AesCryptoPacketUtil(Encoding.UTF8.GetBytes(encryptionKey)); EncryptData = aes.EncryptData; DecryptData = aes.DecryptData; }
public ActionResult Index() { //Author by //https://github.com/paulmowat/EncryptDecrypt string encrypted = "e70edd685b76dce468b82009cb5a788c:9d82eac88651a3bed68854cbf8e2aff246a3c54eaac5d377ccd4980373330447"; //string password = "******"; // string key = "YFpoGQ@$VrUMf64tZ9eg^RiaQSZ^Pw%*"; string key = "XNopKZ@$TiMBf64tZ9eg~RiaQSZ#Pw%*"; string decrypted = DecryptData.Decrypt(encrypted, key); return(View()); }
static void Main(string[] args) { DecryptData decryptData = new DecryptData(); EncryptData encryptData = new EncryptData(); Console.WriteLine("Please input value to Encrypt:"); var val = Console.ReadLine(); var encryptedValue = encryptData.Encryptor(val, true, "lee"); Console.WriteLine($"\nEncrypted Value: {encryptedValue}"); Console.WriteLine($"Decrypted Value: {decryptData.Decryptor(encryptedValue, true, "lee")}"); }