Main Site Documentation

AesCryptoServiceProvider and Session exception


#1

Hi,

I use this code to create Aes provider

var mProvider = new AesCryptoServiceProvider();
mProvider.Mode = CipherMode.CBC;
mProvider.Padding = PaddingMode.PKCS7;
mProvider.BlockSize = 128;
mProvider.KeySize = 128;
mProvider.IV = Encoding.UTF8.GetBytes(AES_IV);
mProvider.Key = CryptoKey.ImportKey(mProvider.Session, Encoding.UTF8.GetBytes(AES_KEY), CryptoKey.KeyClass.Secret, CryptoKey.KeyType.AES, true);

On emulator, it works perfectly, but on FEZ Hydra, it throws NotSupportedException
on Microsoft.SPOT.Cryptoki.Session::.ctor

Is there something special I should do to make it work properly?

Thanks in advance

David


#2

I think ssl/crypto libraries were not included in the hydra freeware. We will look into adding it in 4.3 and you can look into building your own firmware if you feel that you are up to the challenge.


#3

Thanks for reply, but it is not good news :frowning:

I am really not up to creating my own firmware as I do not have time and required skills.

Does someone have customized firmware for FEZ Hydra with ssl/crypto implementations in it? :slight_smile:

Thanks


#4

@ Gus, Can AES fit on the Cerb family if it was implemented in the framework?


#5

Due to the size of the Networking firmware, it is unlikely that encryption can fit in memory. We may see if it were to be possible with the 4.3 firmware as Gus mentioned with Hydra but do not forget that Hydra has 16 MB of external memory.