0

I am using open_ssl to create public and private keys to secure the transaction of a database and the server.

The problem is that the database's (sqllite) only have the input of a byte array of 16bits. The open ssl method that I'm using creates around 600 - 1024 bits, so using that is impossible.

Any idea of what I could do to the public key to use this 16bit encryption technique?

Thanks in advance!

cwiggo
  • 2,541
  • 9
  • 44
  • 87

1 Answers1

0

Sounds like you're trying to use public / private key pairs when symmetric keys ought to be used.

I'd just generate a random string of 16 bytes and use that. You can get it from /dev/urandom on Linux.

Public / private key pairs are longer because they have special requirements that regular symmetric algorithm keys don't. The mudolo of an RSA key pair, for instance, needs to be a multiple of two primes, which excludes a lot of numbers / strings. eg. 60000 isn't a multiple of just two primes - it's factorization shows that it's a multiple of 5^4 * 2^5 * 3.

neubert
  • 15,947
  • 24
  • 120
  • 212