RSA encryption DLL

BlitzMax Forums/BlitzMax Programming/RSA encryption DLL

Filax(Posted 2006) [#1]
Hi :)

I have made a little DLL to encrypt data to RSA format :)

you can do :

- Generate unlimited size RSA key

- Crypt/Decrypt string

- Crypt/Decrypt files

- Crypt/Decrypt memory bank (useful if you want make your hown file format)

I hope that useful for you :)

http://www.blitz3dfr.com/tempo/RSA_Encryption.rar

Example :




kfprimm(Posted 2006) [#2]
Awesome, very useful. I made it into a module.

here's the source

rsaencryption.bmx


The module needs a RSA_Encryption lib file, so use this batch file to create libRSA_Encryption.a and place that .a file into your BlitzMax\lib folder

dll2a.bat
@echo off
pexports RSA_Encryption.dll >RSA_Encryption.def
dlltool -d RSA_Encryption.def -l libRSA_Encryption.a



Filax(Posted 2006) [#3]
thanks for this stuff ! :) i have made a DLL to keep
possibility to use this RSA with blit3D :) but a lib
is a good idea too :)


kfprimm(Posted 2006) [#4]
Well yeah, the only catch is you still need the DLL...what did you write the DLL in? If you compile it as a static library, then you can just import it into the module and no dll is required.


xlsior(Posted 2006) [#5]
This looks very interesting... But a DLL-less version would be even better, ofcourse


Filax(Posted 2006) [#6]
I will try to convert the code to a bmax module. Personaly
i prefer DLL :) look more professional :)))


Dreamora(Posted 2006) [#7]
Not really.
It only means that someone was not able to write the code himself / herself and had to buy others precompiled code ;-)

Otherwise there is no usefull reason for a DLL as it is slower than internal calls.


kfprimm(Posted 2006) [#8]
.


kfprimm(Posted 2006) [#9]
filax, you do not need to write it in BlitzMax. See my post three posts up. :)


Filax(Posted 2006) [#10]
My DLL source use LONG and WORD var : For LONG there is no
problem, but for WORD ? blitzmax seem don't have WORD ?

the doc say :

Byte, Float, Short, Long, Double etc

Because the encrypted string result is different between max
and my dll ? :/

Dreamora : for the look of dll :) It was a joke :)

Khomy Prime : Talking about RSA code (to convert in blitzmax) ! :) Thanks for your code !


kfprimm(Posted 2006) [#11]
For WORD i just use a normal integer...seems to work fine


Filax(Posted 2006) [#12]
A new version of the DLL coming soon with some usefull feature :)


Filax(Posted 2006) [#13]
Hi :) i have a problem with .A of the DLL

i have update Khomy Prime code with the new dll version



This code compile without problem, but when i try to use
the functions, compiler reply me :
K:/PureBasic/Sources/RSA Encryption/.bmx/TestDLL Included.Bmx.gui.release.win32.x86.o(code+0xd0): undefined reference to `RSA_GetLEDKey'
K:/PureBasic/Sources/RSA Encryption/.bmx/TestDLL Included.Bmx.gui.release.win32.x86.o(code+0xf1): undefined reference to `RSA_GetLEDKey'
K:/PureBasic/Sources/RSA Encryption/.bmx/TestDLL Included.Bmx.gui.release.win32.x86.o(code+0x112): undefined reference to `RSA_GetLEDKey'

Any idea ?


Filax(Posted 2006) [#14]
Hi :) this is a little update now you can :

- Play with the keyboard led key :)
- Create/remove virtual hard drive
- Copy/Paste text from clipboard
- Get the os version
- Copy files

http://www.blitz3dfr.com/tempo/RSA_Encryption.rar


Boulderdash(Posted 2006) [#15]
I have one question about RSA encryption...

I did a search on RSA appearantly it has "holes", and if there are so many programs out there to encypt/decrypt it wouldnt it also be known how to HACK it!

wouldnt it be better (hold back your stones please...) to write a unknown encryption method that some one cant just google up the details of, wouldnt it be better if the encryption method was custom made and a secret.


Quote: "In february of 1999 a 465-bits RSA key was cracked in six weeks."


Im using encryption its GREAT! ,my trial version retro 8bit compiler spits out encrypted binaries, (great to encourage people to get full version as encrypted binaries are no good for buring to eprom for use on the real 1982 console and encypted binaries dont work on other emulators also.)

I bet no person could hack my encryption becuase the method is not published, but in your case I even know extactly what method you are using so therefore I could maybe even find something already written to hack it, but how do you hack an unknown encryption method?

Ok so im bound to get shit over this post!

Maybe I could start a competion to break my code with a $10,000 reward, any takers?

Except that I will never pay out because I HATE HACKERS!


Filax(Posted 2006) [#16]
You are right, but maybe you can made a modified RSA code ? :)
i'm looking quantic encryption method, it's a crazy stuff !

http://www.newsfactor.com/perl/story/13468.html


Boulderdash(Posted 2006) [#17]
I chuck the key into the binary ,again details are secret, only registered users (with advanced knowledge of what the result should be) would even know what the result should be in the first place so hacking the code would require a voilation of there license agreement.

The key is hidden in the binary so its hard to find, I admit that im not an encryption expert, but I just dont like the sound of using an encryption method that has a large number of people trying to hack it as part of a competion, sounds dodgy.


kfprimm(Posted 2006) [#18]
.


kfprimm(Posted 2006) [#19]
Hey filax, sorry it took so long but i just checked my mail for the first time in weeks. Are you still getting errors with my bit of code? It sounds to me you haven't updated the libRSA_Encryption.a file. Run the batch file and tell me what happens.