Exemplo n.º 1
0
        public string CreateSerial(uint productID, uint customerID, DateTime date)
        {
            ulong serialTemp      = _serial.CreateSerial(productID, customerID, date);
            ulong serialEncrypted = _algorithm.Encrypt(serialTemp);

            return(_translation.TranslateNumber(serialEncrypted));
        }
Exemplo n.º 2
0
        public string EncryptMessage(string message)
        {
            string result = "";

            foreach (string val in _messageHandler.SplitMessage(message))
            {
                T temp = _cipherAlgorithm.Encrypt(_messageHandler.MakeTFromSubmessage(val));
                result += _translation.TranslateNumber(temp);
            }
            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates encrypted data stored in <see cref="byte"/>[] using the specified symmetric algorithm.
 /// </summary>
 /// <param name="originalFile">Original, non-encrypted, file.</param>
 /// <param name="algorithm">Algorithm used for encryption of the data.</param>
 private void Encrypt(byte[] originalFile, IAlgorithm algorithm)
 {
     EncryptedData = algorithm.Encrypt(originalFile);
 }