very short public key encryption

L

Lloyd Dupont

I would like to (if possible) shuffle my licence key data with a public key
encryption algorithm.
Basically I wonder if it's possible to use buffer of 8 bytes long for my
data.

I did a quick test with RSA (below) but it (apparently) used 128 bytes long
buffer.

Any tips?

----- T.cs -----
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Text;
using System.Security.Cryptography;

// csc /nologo T.cs && t
class RSACSPSample
{

static void Main()
{
byte[] data = new byte[] { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};


RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

byte[] crypted = rsa.Encrypt(data, false);
byte[] decrypt = rsa.Decrypt(crypted, false);

Console.WriteLine("Crypted length "+crypted.Length);
Console.WriteLine("Decrypted length "+decrypt.Length);
foreach(byte b in decrypt)
Console.Write("{0} ", b);
Console.WriteLine();
}
}
 
V

Valery Pryamikov

8 bytes (64 bits) is TOO SHORT EVEN FOR SYMMETRIC ENCRYPTION algorithms.
For asymmetric algorithms - elliptic curves gives one of the shortes keys
(the most efficient attack on ecc is fully exponential), but somewhat more
or less secure ecc keys starts after 140 bits, and you really should use
more than 160 bits for real security. NTRU also has rather short public
keys, however I know very little about NTRU (it's patented).
As about RSA with subexponential factoring algoritms - Jason Papodopoulous'
implementation of the self intialising quadratic sieve (msieve) manages to
factor 200 bits number in about 30 seconds on my 1.6 MHz Centrino laptop.

-Valery.
http://www.harper.no/valery
 
L

Lloyd Dupont

Allright...
I will stay with TEA then ;-)
http://www.ftp.cl.cam.ac.uk/ftp/papers/djw-rmn/djw-rmn-tea.html

--
Regards,
Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
Valery Pryamikov said:
8 bytes (64 bits) is TOO SHORT EVEN FOR SYMMETRIC ENCRYPTION algorithms.
For asymmetric algorithms - elliptic curves gives one of the shortes keys
(the most efficient attack on ecc is fully exponential), but somewhat more
or less secure ecc keys starts after 140 bits, and you really should use
more than 160 bits for real security. NTRU also has rather short public
keys, however I know very little about NTRU (it's patented).
As about RSA with subexponential factoring algoritms - Jason
Papodopoulous' implementation of the self intialising quadratic sieve
(msieve) manages to factor 200 bits number in about 30 seconds on my 1.6
MHz Centrino laptop.

-Valery.
http://www.harper.no/valery

Lloyd Dupont said:
I would like to (if possible) shuffle my licence key data with a public
key encryption algorithm.
Basically I wonder if it's possible to use buffer of 8 bytes long for my
data.

I did a quick test with RSA (below) but it (apparently) used 128 bytes
long buffer.

Any tips?

----- T.cs -----
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Text;
using System.Security.Cryptography;

// csc /nologo T.cs && t
class RSACSPSample
{

static void Main()
{
byte[] data = new byte[] { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};


RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

byte[] crypted = rsa.Encrypt(data, false);
byte[] decrypt = rsa.Decrypt(crypted, false);

Console.WriteLine("Crypted length "+crypted.Length);
Console.WriteLine("Decrypted length "+decrypt.Length);
foreach(byte b in decrypt)
Console.Write("{0} ", b);
Console.WriteLine();
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top