Number Nerdery

For other topics related to the FreeBASIC project or its community.
srvaldez
Posts: 2152
Joined: Sep 25, 2005 21:54

Number Nerdery

Postby srvaldez » Mar 18, 2018 13:20

I saw this link at the FASM forum https://2ton.com.au/rants_and_musings/n ... rdery.html and thought that since it could be related to cryptography that others might be interested .
Mihail_B
Posts: 271
Joined: Jan 29, 2008 11:20
Location: Romania
Contact:

Re: Number Nerdery

Postby Mihail_B » Mar 18, 2018 15:55

This is nice stuff :)
dodicat
Posts: 6022
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Number Nerdery

Postby dodicat » Mar 18, 2018 19:07

I like the start of paragraph 3:
"All of the primes we generate are almost certainly prime."
Certainly confuses any potential cracker and non cracker.
deltarho[1859]
Posts: 2100
Joined: Jan 02, 2017 0:34
Location: UK

Re: Number Nerdery

Postby deltarho[1859] » Mar 18, 2018 21:05

My AES-RSA-ECDSA application is undergoing a complete rewrite. My aim is for a Sender to select a file for encryption and do nothing else. A random 256 bit key will be determined and used to encrypt the message with AES. An output file will be opened with the head holding the random AES IV followed by the encrypted message. The random key will then be encrypted using RSA 3072 and the result appended to the output file. The encrypted message will be hashed with SHA256 and the hash appended to the output file. The hash will then be signed with ECDSA 256 and the signature appended to the output file. The file will be closed and sent to the Receiver with a .enc extension.

The Receiver will navigate to the .enc and request a decryption. The above process is reversed and the result will be the plaintext of the encrypted message.

Neither the Sender nor Receiver will ever see the password in the light of day and since it is only used once then no copy is required and we have, analogously, a one time pad. Since the password will be a 256 bit binary key then there will be no need for key stretching; as with passwords which have a limited entropy.

With a successful decryption this process ensures that only the Sender could have sent the .enc file and, the signature being digital, will not be in a position to deny sending it and the message will be authenticated.

The primes used are generated via Windows APIs and the RSA public/private keys and ECDSA public/private keys, similar to those in the link, will be different for each and every generation. For RSA 3072 and ECDSA 256 the four keys take between two and five seconds to make. Being a random search it is impossible to tell how close we are to a solution. With that level of security strength the keys will not require to be refreshed that often.

So, when will the new AES-RSA-ECDSA be available? I may be gone sometime on this one. I am keeping away from the keyboard and doing a lot of designing on paper first.
deltarho[1859]
Posts: 2100
Joined: Jan 02, 2017 0:34
Location: UK

Re: Number Nerdery

Postby deltarho[1859] » Mar 18, 2018 23:34

In srvaldez's link there is mention of Sophie German primes. About eight years ago a PowerBASIC member John Gleason and I collaborated on a PB random number generator replacement using George Marsaglia's Multiply-With-Carry method. It only had a period just less than 64 bit but that was a lot more powerful than PB's 32 bit. It required a Sophie German prime and we used one for a while. John, being an exceptional number nerd, came up with some code to generate Sophie German primes. He generated 384 of them and we put them into Data statements. When we ran the generator one of the primes was chosen at random giving us then 384 possible sequences to make use of. It was John who found PractRand which I used to test the generators that I have written with FreeBASIC.
deltarho[1859]
Posts: 2100
Joined: Jan 02, 2017 0:34
Location: UK

Re: Number Nerdery

Postby deltarho[1859] » Mar 19, 2018 2:37

BTW, if anyone spots a weakness in the new AES-RSA-ECDSA design then please let me know. I am some way from coding yet although I have designed a form. It is probably as minimalist as we can get and in complete contrast to the crypto stuff being employed.
srvaldez
Posts: 2152
Joined: Sep 25, 2005 21:54

Re: Number Nerdery

Postby srvaldez » Mar 19, 2018 14:36

this is a bit off topic but I see no sense in opening a new thread, while searching the web for inverse square root a mention was made of HAKMEM https://w3.pppl.gov/~hammett/work/2009/AIM-239-ocr.pdf
it's a hodgepodge of hacks and algorithms, but as the name suggest it was something like a memo and it may be difficult to decipher.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest