AES encryption algorithm PureBasic LIB available !

Share your advanced PureBasic knowledge/code with the community.
newbie
Enthusiast
Enthusiast
Posts: 296
Joined: Tue Jul 29, 2003 5:47 pm
Location: FRANCE
Contact:

Post by newbie »

@the fool

I found that on the net :
Sabharwal says that AES offers far stronger encryption than RC4. The main drawback is that AES requires more processing horsepower, and may only be used with new WLAN products. "Longer-term vendors should look towards AES simply because it is essentially a more secure encryption technology, versus RC4 (which both WEP and TKIP use)," says Sabharwal.
- Registered PB user -

Using PB 4.00
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

ok thanks.
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

newbie wrote:yes ;)

what are the modifications ? just to know :)

EDIT : I did the test, and here the results :

Sec's lib = 1281ms
Max's lib = 1578ms

of course those results are only for my computer :)
Yep, I can confirm this.

Maybe I should use this opportunity to learn on optimazation. :)

@ the fool:

I think, AES is stronger, but RC4 is easier to use. It doesn't work with blocks so doesn't need padding.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

newbie wrote:what are the modifications ? just to know :)
AES256Encrypt(@plain,@key) replaces with AES256Encrypt(@plain) and
Add AES256Init(@key), call this function first and call once expect change key.
I got this idea from Max^2 :wink: ) (but it is exist in blowfish lib heh)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

similar function names would be nice :-)

i'm not deep enough into en/de cryption yet, does this do asymmetric keys as well?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

Hi,

great AES libs! Thanks a lot!

One question: does someone know an URL where the AES specifiation is published?
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

dell_jockey wrote:Hi,

great AES libs! Thanks a lot!

One question: does someone know an URL where the AES specifiation is published?
I guess you can find something useful here:
http://csrc.nist.gov/CryptoToolkit/aes/
newbie
Enthusiast
Enthusiast
Posts: 296
Joined: Tue Jul 29, 2003 5:47 pm
Location: FRANCE
Contact:

Post by newbie »

I have updated my code for the v2 Lib from Sec on the page 1 :
viewtopic.php?p=66818#66818

About the official document, doesn't the FIPS PDF document linked on my first post is what you are looking for ?

@blueznl
AES is a symetric encryption algorithm only, so, for those who may be don't know, means that the same key is used to both encrypt and decrypt.
An example of an asymetric algorithm could be the well known RSA.

@Sec
better like that indeed, no more "static" variables in my procedure (using a global was making the whole to bug).
More convenient :)
- Registered PB user -

Using PB 4.00
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

sec wrote:On my machine , mine is abit faster :twisted:
Eat this! :twisted:

http://www.host4scripts.de/pub/AES
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

maybe but in fact
mine/yours
766/860 ms
765/907
781/875
Do not go to use mmx or special things
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

sec wrote:maybe but in fact
mine/yours
766/860 ms
765/907
781/875
Do not go to use mmx or special things
Lol! That is funny. I got (for 5000000 loops) 5000ms to 2500. :)

Edit: Did with the original sample and the result is 1052/510.

Ah, just saw the disclaimer. MMX is cool, hehe.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

I tried to 2147483647loops and mine have a better result.
LOlz (please don't try) :lol:
maybe newbie or other will give result (not me or you :lol: )
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

sec wrote:I tried to 2147483647loops and mine have a better result.
LOlz (please don't try) :lol:
maybe newbie or other will give result (not me or you :lol: )
Updated it another time. The latest one doesn't use MMX but strangely gives better results (slightly).

http://www.host4scripts.de/pub/AES

Going to try them on my notebook to check there.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

Have do any special thing? can give me hint improve mine :wink:
mine/yours
765/656
797/640
796/641
btw I will return later.
Max.²
Enthusiast
Enthusiast
Posts: 175
Joined: Wed Jul 28, 2004 8:38 am

Post by Max.² »

sec wrote:Have do any special thing? can give me hint improve mine :wink:
mine/yours
765/656
797/640
796/641
btw I will return later.
At the moment I am just confused; the one lib you tried isn't supposed to work. At least it doesn't on my notebook. Or I copied the wrong file. WHAT A MESS. :lol:

Ah, looks like this is a problem with the Beta 3.91 on the Notebook. The Lib works.
Post Reply