Advanced Encryption Standard

Advanced Encryption Standard

Postby Silvio.Falconi » Thu Dec 11, 2014 8:12 am

Some have an AES algorith or Twofish encript or a smal sample ?
see http://it.wikipedia.org/wiki/Advanced_Encryption_Standard

I found a sample on delphi but I cannot Know How converte it

http://www.example-code.com/delphi/aes_stringEncryption.asp

Code: Select all  Expand view
procedure TForm1.Button1Click(Sender: TObject);
var
crypt: TChilkatCrypt2;
success: Integer;
password: String;
hexKey: String;
text: String;
encText: String;
decryptedText: String;

begin
crypt := TChilkatCrypt2.Create(Self);

success := crypt.UnlockComponent('Anything for 30-day trial');
if (success <> 1) then
  begin
    ShowMessage('Crypt component unlock failed');
    Exit;
  end;

password := 'secretPassPhrase';

crypt.CryptAlgorithm := 'aes';
crypt.CipherMode := 'cbc';
crypt.KeyLength := 128;

//  Generate a binary secret key from a password string
//  of any length.  For 128-bit encryption, GenEncodedSecretKey
//  generates the MD5 hash of the password and returns it
//  in the encoded form requested.  The 2nd param can be
//  "hex", "base64", "url", "quoted-printable", etc.
hexKey := crypt.GenEncodedSecretKey(password,'hex');
crypt.SetEncodedKey(hexKey,'hex');

crypt.EncodingMode := 'base64';
text := 'The quick brown fox jumped over the lazy dog.';

//  Encrypt a string and return the binary encrypted data
//  in a base-64 encoded string.
encText := crypt.EncryptStringENC(text);

Memo1.Lines.Add(encText);

//  Decrypt and show the original string:
decryptedText := crypt.DecryptStringENC(encText);

Memo1.Lines.Add(decryptedText);
end;




I found also a javascript complete source
http://home.versatel.nl/MAvanEverdingen/Code/

to encript on RC4, AES, Serpent, Twofish, Caesar and RSA ciphers.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6941
Joined: Thu Oct 18, 2012 7:17 pm

Re: Advanced Encryption Standard

Postby Baxajaun » Thu Dec 11, 2014 12:23 pm

Hi Silvio,

Luiz Rafael Culik Guimaraes has AES function for xHarbour code in C.

https://groups.google.com/forum/#!topic/comp.lang.xharbour/DXDjjakdt8c

Regards
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: Advanced Encryption Standard

Postby Silvio.Falconi » Thu Dec 11, 2014 5:28 pm

thanks
I sent message to luiz but I not had any messages
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6941
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests

cron