Esempio n. 1
0
 public string EncryptWithSessionB64(string text)
 {
     byte[] IV         = m_sessionIV;
     byte[] encMessage = SCSC_AES.Encrypt(text, m_sessionPassword, ref IV);
     byte[] im         = new byte[IV.Length + encMessage.Length];
     //Copy from IV to output, IV size bytes (must be 32)
     Array.Copy(IV, im, IV.Length);
     Array.Copy(encMessage, 0, im, IV.Length, encMessage.Length);
     return(Convert.ToBase64String(im));
 }
Esempio n. 2
0
 //AES256 with key from SHA256 of user's password used for encrypt/decrypt user data
 public string EncryptUserDataB64(string text)
 {
     return(Convert.ToBase64String(SCSC_AES.Encrypt(text, m_shaPassword, ref m_shaUser)));
 }