hii

i'm looking for good and fast encryption algo.

any suggestion ?



bye

eko
Posted on 2001-12-29 17:16:03 by eko
Posted on 2001-12-29 17:25:52 by bitRAKE
Posted on 2001-12-29 18:36:39 by peterverstappen
Use twofish instead. Or have a look at RC6. Perhaps Serpent, though
I dunno much about it. Rijndael (AES) seems to be pretty nice, although
some people have a conspiracy theory about Rijndael being chosen
for AES because NSA can break it... who knows :). Don't even consider
DES or 3DES.
Posted on 2001-12-29 18:44:51 by f0dder
F0dder, they said the same about DES, but 20-odd years later no-one's proved it yet.
Posted on 2001-12-30 02:52:46 by peterverstappen
On the net there's a very nice VB version of Rijndael floating around, and VB's pretty easy to read.

EDIT: Found it :grin: :
Rijndael in a VB class
Posted on 2001-12-30 03:10:35 by Qweerdy
thanks for all your suggestion . i dont understand much in crypto . and i want an encryption that will be secure ... very secure and fast ! .


anyideas ( please write what you think on the encryption ,security, speed and etc..)

thanks

bye

eko
Posted on 2001-12-30 07:54:08 by eko
pv: nobody has proven it, probably because NSA are the only guys
capable of doing that... and they wouldn't reveal backdoors in their
own systems ;). But we all know DES is pretty fast to bruteforce,
and it's said that DES has fast methods to do it... be cautious about
any algorithm that uses S-boxes, you never know if the algorithm
designer has inverse s-boxes...

twofish and rijndael are both supposed to be fast and pretty secure.
As far as I remember, at least twofish (and possibly rijndael?) uses
s-boxes, but... that doesn't stop me from using them.

RC6 is supposed to be pretty darn secure without losing too much
speed, but I have no experience with it whatsoever.

The rest of the algos? Perhaps serpent, but stay away from anything
else :).
Posted on 2001-12-30 10:53:50 by f0dder
Isn't RSA the strongest?
Posted on 2001-12-30 11:46:14 by Nordbon
RSA is a public-key encryption method. It is *very* slow, and thus
not suited for general use. When you use pubkey encryption in eg
PGP, what is really done is that PGP generates a random key for
a block cipher, and encrypts this key with the public-key encryption.
The rest of the message is encrypted with the block cipher (with the
random key).

Also, if you use RSA, use bitsizes of at least 2048... preferably 4096.
Posted on 2001-12-30 11:58:18 by f0dder
hey fodder =) 1024-bits keys are still good and secure enough for R.S.A., you only have to choose a secure random number generator for the key.
for fast encryption, i' d recommend block-ciphers, twofish, rijndael and serpent are quite good, if you want a tiny and fast algo, you can check T.E.A. =)
Posted on 2001-12-31 06:23:55 by roy
I wouldn't use less bits than 2048 for RSA if security really mattered.
If you're already going through the trouble of using a pubkey algo,
doubling or quadrupling the bitsize isn't too much of a hassle.
Posted on 2001-12-31 06:35:29 by f0dder
does t.e.a have good security?
Posted on 2001-12-31 07:10:23 by eko
As far as I have understood, TEA is primarily useful because it can
be implemented with VERY little code and without lookup tables,
and it's pretty fast. There's a number of problems, but most of this
has been fixed in later revisions - you gotta be careful when choosing
the version to be sure you choose one without flaws :). As for the
algorithm itself, I don't know how strong it is - but I got a feeling
it's not quite as strong as eg twofish or RC6.
Posted on 2001-12-31 07:15:57 by f0dder
do you know where can i get RC6 algorithm . or even better where to get it in asm ?


bye

eko
Posted on 2001-12-31 13:04:40 by eko

do you know where can i get RC6 algorithm . or even better where to get it in asm ?


bye

eko




;Copyright (C) 1999 Cecchinel Stephan <inter.zone@free.fr>
;
;$Id: rc6.asm,v 1.3 2000/12/10 08:20:36 konst Exp $
;
;implementation of RC6 crypto algorythm
;
;RC6 algo mainly consists of 3 functions:
; setkey in_key, length ->>set crypto key of length bits (256)
; encrypt in_block,out_block ->>encrypt 16 byte block
; decrypt in_block,out_block ->>decrypt 16 byte block
;
; really simple to implement....no?
;
;10-Sep-2000 cleanup (KB)

%include "system.inc"

CODESEG

global RC6_Setkey
global RC6_Encrypt
global RC6_Decrypt

PROC RC6_Setkey, in_key, key_len

%define a dword[ebp-4] ;local vars on the stack
%define b dword[ebp-8]
%define i dword[ebp-12]
%define j dword[ebp-16]

pusha

sub esp,byte 16

mov edi,l_key
mov dword[edi],0x0b7e15163
xor ecx,ecx
inc ecx
.cpy:
mov eax,dword [-4+edi+ecx*4]
add eax,0x09e3779b9
mov dword [edi+ecx*4],eax
inc ecx
cmp ecx,byte 44
jb .cpy

xor ecx,ecx
mov esi,in_key
mov edx,key_len
shr edx,5
.cpy1:
mov eax,[esi+ecx*4]
mov [edi+ecx*4],eax
inc ecx
cmp ecx,edx
jb .cpy1

mov esi,ll ;esi=ll
dec edx ;edx=t=(key_len/32)-1
xor ecx,ecx ;ecx=k=0
mov a,ecx
mov b,ecx
mov i,ecx
mov j,ecx ;a=b=i=j=0
.cpy2:
push ecx
mov ebx,i
mov eax,[edi+ebx*4]
add eax,a
add eax,b
rol eax,3
add b,eax ;b+=a
mov a,eax ;a=rol(l_key[i]+a+b
mov ebx,j
mov eax,dword [esi+ebx*4]
add eax,b
mov ecx,b
rol eax,cl
mov b,eax ;b=rol(ll[j]+b,b)
mov eax,a
mov ebx,i
mov [edi+ebx*4],eax ;l_key[i]=a
mov eax,b
mov ebx,j
mov [esi+ebx*4],eax ;ll[j]=b
mov eax,i
inc eax
cmp eax,byte 43
jnz .s1
xor eax,eax
.s1:
mov i,eax ;i=i+1 %43

mov eax,j
inc eax
cmp eax,edx
jnz .s2
xor eax,eax
.s2:
mov j,eax
pop ecx
inc ecx
cmp ecx,132
jb .cpy2
mov eax,edi

add esp,byte 16
popa
ENDP


;---------------------------------------
;encrypt:
;
; input: edi=in_block
; esi=out_block

PROC RC6_Encrypt, in_block, out_block
pusha
mov esi,out_block
mov edi,in_block
push esi
mov esi,l_key
mov eax,[edi] ;a=in_block[0]
mov ebx,[edi+4]
add ebx,[esi] ;b=in_block[1]+l_key[0]
mov ecx,[edi+8] ;c=in_block[2]
mov edx,[edi+12]
add edx,[esi+4] ;d=in_block[3]+l_key[1]
lea ebp,[esi+8]
.boucle:
lea esi,[edx+edx+1]
imul esi,edx
rol esi,5 ;u=rol(d*(d+d+1),5)

lea edi,[ebx+ebx+1]
imul edi,ebx
rol edi,5 ;t=rol(b*(b+b+1),5)

push ecx
mov ecx,esi
xor eax,edi
rol eax,cl
add eax,[ebp] ;a=rol(a^t,u)+l_key[i]
pop ecx

push eax
xchg ecx,eax
mov ecx,edi
xor eax,esi
rol eax,cl
add eax,[ebp+4] ;c=rol(c^u,t)+l_key[i+1]
xchg ecx,eax
pop eax

push eax
mov eax,ebx
mov ebx,ecx
mov ecx,edx
pop edx
add ebp,byte 8
cmp ebp,(l_key+(42*4))
jnz .boucle

pop edi
mov esi,l_key
add eax,[esi+(42*4)]
mov [edi],eax
mov [edi+4],ebx
add ecx,[esi+(43*4)]
mov [edi+8],ecx
mov [edi+12],edx

popa
ENDP

;---------------------------------------
PROC RC6_Decrypt, in_blk2, out_blk2

pusha
mov esi,out_blk2
push esi
mov edi,in_blk2
mov esi,l_key

mov edx,[edi+12] ;d=in_blk[3]
mov ecx,[edi+8]
sub ecx,[esi+(43*4)] ;c=in_blk[2]-l_key[43]
mov ebx,[edi+4] ;b=in_blk[1]
mov eax,[edi]
sub eax,[esi+(42*4)] ;a=in_blk[0]-l_key[42]
lea ebp,[esi+(40*4)]

.boucle2:
push edx
mov edx,ecx
mov ecx,ebx
mov ebx,eax
pop eax

lea esi,[edx+edx+1]
imul esi,edx
rol esi,5 ;u=rol(d*(d+d+1),5)

lea edi,[ebx+ebx+1]
imul edi,ebx
rol edi,5 ;t=rol(b*(b+b+1),5)

push eax
xchg ecx,eax
mov ecx,edi
sub eax,[ebp+4]
ror eax,cl
xor eax,esi
xchg ecx,eax
pop eax

push ecx
mov ecx,esi
sub eax,[ebp]
ror eax,cl
xor eax,edi
pop ecx

sub ebp,byte 8
cmp ebp,l_key
jnz .boucle2

mov esi,ebp
pop edi
sub edx,[esi+4]
mov [edi+12],edx ;out_blk[3]=d-l_key[1]
mov [edi+8],ecx ;out_blk[2]=c
sub ebx,[esi]
mov [edi+4],ebx ;out_blk[1]=b-l_key[0]
mov [edi],eax ;out_blk[0]=a

popa
ENDP

UDATASEG

l_key resd 45 ;internal RC6 key
ll resd 9

END
Posted on 2001-12-31 13:15:22 by bazik
thanks you
Posted on 2001-12-31 13:52:05 by eko
nice

bAZiK do you have also an asm implementation of RC4?
Posted on 2002-01-02 01:32:45 by adapix
in 0xb9 bytes

i hope you like

ancev
Posted on 2002-01-02 09:28:02 by ancev
thanks ancev
its really good coded...
Posted on 2002-01-02 10:11:17 by adapix