Archive for the 'Crypto/Security' Category

OpenSSL/RSA: toolkit & implementation ( for Ondaquadra E-zine )

[This article appeared on OndaQuadra0A Elettronic Magazine - Nov 2003 ]
OpenSSL/RSA: toolkit & implementation
Article && sources by Paolo Ardoino AKA binduck
<paolo.ardoino@gmail.com>

0. Intro
1 RSA - Teoria
1.1 OpenSSL/RSA [genrsa,rsa,rsautl]
(generare chiave,cifrare/decifrare,firmare,...)
1.1.1 GPG
1.2 Impariamo ad implementare RSA nei nostri programmi
1.2.1 RSA - Headers
1.2.2 RSA - Le chiavi
1.2.3 RSA - Cifrare e decifrare

0. Intro

In questo articolo voglio illustrarvi le basi che vi permetteranno di
capire e implementare l' algoritmo RSA.
1]Vedremo, quindi, come utilizzare il toolkit openssl (ne vedremo le
principali funzioni, come creare le chiavi, come cifrare/decifrare
dati).
2]Vedremo insieme le basi delle librerie openssl, e in particolare
quelle che vi permetteranno di implementare l'algoritmo nei vostri
programmi.

Per affrontare la lettura di questo articolo avrete bisogno di
conoscere:
- il linguaggio C
- se volete comprendere la parte matematica dovrebbe bastare
l'infarinatura di matematica fornitavi nelle elementari e nelle medie.
- dovreste avere openssl e le librerie (/usr/include/openssl/) se vi
mancano....installatele.
Read more »

Random prime numbers using OpenSSL bignum

This simple C program shows how to generate random prime numbers using openssl bignum libraries; it takes as argument the length of the primes in bits.Here’s the source Read more »

Hijacking Linux kernel 2.6 sys_connect system call

In Linux-2.4.x kernel it was very simple create an lkm to hijack the sys_connect system call using the exported symbol:

1
extern void *sys_call_table[];

So, it is very simple to substitute the pointer to another system call, the one we have created!

1
2
3
4
5
6
static inline _syscall1(int,close,int,fd);
int ( * o_socketcall) (int, unsigned long *);
int my_socketcall (int, unsigned long *);
o_socketcall = sys_call_table[SYS_socketcall]; //saving original pointer
sys_call_table[SYS_socketcall] = (void *)my_socketcall; //hijacking system call
sys_call_table[SYS_socketcall] = (void *)o_socketcall; //restoring original syscall

( Read Phrack n.50 to learn more about system call hijacking in Linux-2.4.x kernels )

In Linux-2.6.x kernels the sys_call_table symbol is no more exported for security and stability reasons. So how can we hijack connections? Read more »

Factoring large integers: pollard p-1 method

It is a number theoretic integer factorization algorithm, invented by John Pollard in 1974. It is a special-purpose algorithm, meaning that it is only suitable for integers with specific types of factors; it is the simplest example of an algebraic-group factorisation algorithm.

From Wikipedia

Pollard p-1 algorithm

  1. N > 2
  2. b = ( a finite integer )
  3. Let k be a multiple of all (or nearly all) integers <= b ( i.e k = b )
  4. 2 <= a <= N - 2 ( with a random )
  5. Compute Greatest Common Divisor (GCD) between a^k-1(mod N) and N
    • So we need to comput a^k-1 in ZN and to find the Greatest Common Divisor between this value and N ( i.e : use the Euclid’s algorithm )
  6. If GCD = 1 then return to 4. ; else if GCD > 1 then GCD is a prime number and we found a factor of N

Read more »

Factoring large integers: classical method

RSA strength depends on the difficulty to find prime factors of large integers and this is why these kind of algorithms gain a lot of attention.
Take an RSA key of 512 bits [ RSA-512 ]….
Read more »

Simple file encrypter/decrypter ( DES / Blowfish / IDEA / MD5 / RSA algorithms )

UNISFED is a simple file encrypter / decrypter that supports DES / Blowfish / IDEA / MD5 / RSA algorithms based on OpenSSL libraries.

Read more »

« Previous PageNext Page »