[RESOLU] AES et label
Publié : sam. 23/avr./2011 16:15
Salut
J'utilise les commandes AESDecoder(*Input, *Output, Size, *Key, Bits, *InitializationVector) et AESencoderr(*Input, *Output, Size, *Key, Bits, *InitializationVector)
En tant que *key et *InitializationVector, j'utilise comme l'exemple des datasection avec labels.
je voudrais faire ceci :
mais bien sur ça ne marche pas.
savez -vous comment on peut "modifier" l'adresse du label dans la procedure aesdecoder() ou aesencoder() ?
Merci
.
J'utilise les commandes AESDecoder(*Input, *Output, Size, *Key, Bits, *InitializationVector) et AESencoderr(*Input, *Output, Size, *Key, Bits, *InitializationVector)
En tant que *key et *InitializationVector, j'utilise comme l'exemple des datasection avec labels.
Code : Tout sélectionner
String$ = "Hello this is a test for AES"
*CipheredString = AllocateMemory(Len(String$)+1) ; Space for the string and its
*DecipheredString = AllocateMemory(Len(String$)+1) ; null terminating character (ASCII mode)
If AESEncoder(@String$, *CipheredString, Len(String$), ?Key, 128, ?InitializationVector)
Debug "Ciphered: "+PeekS(*CipheredString)
AESDecoder(*CipheredString, *DecipheredString, Len(String$), ?Key, 128, ?InitializationVector)
Debug "Deciphered: "+PeekS(*DecipheredString)
EndIf
DataSection
Key:
Data.b $06, $a9, $21, $40, $36, $b8, $a1, $5b, $51, $2e, $03, $d5, $34, $12, $00, $06
InitializationVector:
Data.b $3d, $af, $ba, $42, $9d, $9e, $b4, $30, $b4, $22, $da, $80, $2c, $9f, $ac, $41
EndDataSection
Code : Tout sélectionner
String$ = "Hello this is a test for AES"
*CipheredString = AllocateMemory(Len(String$)+1) ; Space for the string and its
*DecipheredString = AllocateMemory(Len(String$)+1) ; null terminating character (ASCII mode)
keynew = ?(Key+"_01")
vector = ?(InitializationVector+"_01")
If AESEncoder(@String$, *CipheredString, Len(String$), keynew, 128,vector )
Debug "Ciphered: "+PeekS(*CipheredString)
AESDecoder(*CipheredString, *DecipheredString, Len(String$), ?Key, 128, ?InitializationVector)
Debug "Deciphered: "+PeekS(*DecipheredString)
EndIf
DataSection
Key_01:
Data.b $06, $a9, $21, $40, $36, $b8, $a1, $5b, $51, $2e, $03, $d5, $34, $12, $00, $06
InitializationVector_01:
Data.b $3d, $af, $ba, $42, $9d, $9e, $b4, $30, $b4, $22, $da, $80, $2c, $9f, $ac, $41
Key_02:
Data.b $06, $a9, $21, $40, $36, $b8,$d5, $34, $12, $00, $06
InitializationVector_02:
Data.b $3d, $af, $ba, $42, $9d, $9e, $da, $80, $2c, $9f, $ac, $41
EndDataSection
savez -vous comment on peut "modifier" l'adresse du label dans la procedure aesdecoder() ou aesencoder() ?
Merci
