encryption - Generate AES key in C# for windows store app -



encryption - Generate AES key in C# for windows store app -

i need genearte 256 bit key aes encryption in c# fore windows store app. ised next code , getting execption. please point me doing wrong.

public string genaeskey() { uint32 keysize = 32; cryptographickey key; symmetrickeyalgorithmprovider algorithm = symmetrickeyalgorithmprovider.openalgorithm(symmetricalgorithmnames.aesecb); ibuffer keymaterial = cryptographicbuffer.generaterandom((keysize + 7) / 8); seek { key = algorithm.createsymmetrickey(keymaterial); homecoming key.tostring(); } grab { homecoming null; }

the error "value not fall within expected range." @ algorithm.createsymmetrickey(keymaterial); command.

my bad. problem in this.

uint32 keysize = 32;

changed to

uint32 keysize = 256;

and evrything good

c# encryption windows-phone-8.1

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -