Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function EncryptText_AES_128(input: string; password: string): ansistring;
- var
- Codec: TCodec;
- CipherText: String;
- begin
- Codec := TCodec.Create(nil);
- try
- Codec.CryptoLibrary := TCryptographicLibrary.Create(Codec);
- //
- Codec.StreamCipherId := BlockCipher_ProgID;
- Codec.BlockCipherId := Format(AES_ProgId, [128]);
- Codec.ChainModeId := ecb_ProgId;
- //
- Codec.Password := Password;
- Codec.EncryptString(input, CipherText,tencoding.UTF8);
- //
- Result := (CipherText);
- finally
- Codec.Free;
- end;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- memo1.Lines.Add( EncryptText_AES_128(#$00#$01#$02#$03#$04#$05#$06#$07#$08#$09#$0a#$0b#$0c#$0d#$0e#$0f,#$78#$34#$90#$fd#$6a#$6c#$90#$f0#$72#$36#$a8#$ed#$40#$27#$94#$f8#$73#$2c#$96#$fb#$71#$1f#$a0#$f4#$6c#$34#$9a#$c4#$79#$24#$93#$e8));
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement