Пытаюсь зашифровать byte[] в AES CBC. Конечный буфер (bufferEncrypt) имеет значение NULL.
private byte[] Encrypt(byte[] data)
{
byte[] secretKey = new byte[] { 1, 2, 3 };
IBuffer key = Convert.FromBase64String(Convert.ToBase64String(secretKey.ToArray()).ToString()).AsBuffer();
Debug.WriteLine(key.Length);
SymmetricKeyAlgorithmProvider algorithmProvider = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbc);
CryptographicKey cryptographicKey = algorithmProvider.CreateSymmetricKey(key);
IBuffer bufferEncrypt = CryptographicEngine.Encrypt(cryptographicKey, data.AsBuffer(), null);
return bufferEncrypt.ToArray();
}
Вот что показывает отладчик (Имя, Значение, Тип):
+ this {Project.Auth} Project.Auth
+ data {byte[15]} byte[]
bufferEncrypt null Windows.Storage.Streams.IBuffer
+ cryptographicKey {Windows.Security.Cryptography.Core.CryptographicKey} Windows.Security.Cryptography.Core.CryptographicKey
+ key {System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer} Windows.Storage.Streams.IBuffer {System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer}
+ algorithmProvider {Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider} Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider
+ SecretKey Count = 16 System.Collections.Generic.List<byte>
В чем моя ошибка?
Частный дом престарелых в Киеве: комфорт, забота и профессиональный уход
Знаю, что популярная проблемаНо нужно срочно, а я вообще не бум-бум
Есть метод контроллера сервера Refresh(DateTime? Date) Есть метод jQuery который отправляет ajax-запрос по URL наподобие http://localhost:1234/Home/Refresh?Date=2304
Подскажите пожалуйста, как (c# winforms vs2010) обратиться (чтобы выгрузить в word) к привязанным данным "Value_1 и Value_2"? Те
Пытаюсь запустить простейший код консольного приложения: