### asymetrical encryption/decryption?

Posted:

**Aug 12th, '18, 21:20**Does GP featrue an asymetrical cryptosystem? If not it would be nice if something like RSA rould be implemented.

Welcome to the GP Community!

https://gpblocks.org/forum/

Page **1** of **1**

Posted: **Aug 12th, '18, 21:20**

Does GP featrue an asymetrical cryptosystem? If not it would be nice if something like RSA rould be implemented.

Posted: **Aug 14th, '18, 17:04**

I think you could just add this in a project with blocks because right now GP supports hashing, SHA256, and encoding for multiple things.

Posted: **Aug 15th, '18, 11:44**

Hmm, I am able to use asymetrical cryptosystems (generating private and public keys tor transfer data over networks between my Python projects) but I am not an expert, so I don't know how souch system works in detail. I am not sure if souch hashing tools like sha256 are enoght to build my own asymetrical encryption and decryption system. But I'll try to experiment a bit more with those functionalities already buildin GP.

Posted: **Aug 24th, '18, 15:49**

Hi, I have tried working with asymmetrical encryption in GP with limited success. The biggest problem that I ran into was that there is a limit to how large integers are allowed to be in GP (1073741823 is the largest allowed integer).

Posted: **Aug 24th, '18, 17:19**

Interessting, yes the integers are not that big. But could you upload your sucess try as an project please? I wasn't sucess yet to something simular, I know how to use several asymetrical entryption-tools but I don't exactly know how those cryptosystems works.

Posted: **Aug 24th, '18, 17:25**

Is there no big math in GP?

Posted: **Aug 27th, '18, 21:33**

There is a little bit of support (addition of big numbers)Is there no big math in GP?

I had a go at trying to add multiplication in a earlier beta but it wasn't at all optimised for speed so would be too slow

Simon

Posted: **Sep 1st, '18, 17:01**

As Gosha pointed out, the RSA encryption system involves multiplying and taking the modulus of very large numbers (500-1000 decimal digits). If you have a system that supports working with such large integers, then RSA isn't too difficult to implement. As I recall, the most difficult part is generating a key pair, which involves finding large prime numbers. But one could use a Linux command line tool to generate the key pair.

Unfortunately, GP does not currently have a large integer class. So, an interesting subproblem is to create such a class that supports basic arithmetic (+, -, *, and /) and printing large integers. When I was working on the Squeak project, I implemented such a package, and it was actually sort of interesting. You use the same algorithms for addition, subtraction, multiplication, and division that you learned back in elementary school, but typically use a large base like 256 rather than base 10 so you can process more bits with each of the processor's multiple/divide instructions. I used this book as my guide:

https://www.amazon.com/Art-Computer-Pro ... 0201896842

But Wikipedia articles might also be a good reference, if anyone wants to take this on. Strange as it may sound, implementing arithmetic that works for arbitrarily large integers is actually fun!

Unfortunately, GP does not currently have a large integer class. So, an interesting subproblem is to create such a class that supports basic arithmetic (+, -, *, and /) and printing large integers. When I was working on the Squeak project, I implemented such a package, and it was actually sort of interesting. You use the same algorithms for addition, subtraction, multiplication, and division that you learned back in elementary school, but typically use a large base like 256 rather than base 10 so you can process more bits with each of the processor's multiple/divide instructions. I used this book as my guide:

https://www.amazon.com/Art-Computer-Pro ... 0201896842

But Wikipedia articles might also be a good reference, if anyone wants to take this on. Strange as it may sound, implementing arithmetic that works for arbitrarily large integers is actually fun!