?
Solved

Adding simple RSA algorithm to a project

Posted on 2003-03-06
11
Medium Priority
?
382 Views
Last Modified: 2012-06-27
I would like to add the public key algorithm RSA to a project. While I am generally famliar with public key cryptography (pretty much user knowledge, maybe a little more) I am not familiar with how to code it.

I keep finding a couple of algorithm source codes but nothing that I understand.

Basically I would like something that presents me the functions

Encrypt(..)
Decrypt(..)

and maybe

CreatePubKey(..)
CreatePrivKey(..)

something like that. Everything I find is awfully complicated (e.g. http://www.eskimo.com/~weidai/cryptlib.html) or too simple it seems.

Does anybody have suggestions? All I really need to encrypt / decrypt is ONE string - nothing more.

Thanks!
0
Comment
Question by:FlorianJaeger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 
LVL 6

Expert Comment

by:gj62
ID: 8084866
Hello again - I thought you said this was just as easy as TEA... <just kidding>

Anyhow, have you looked at any of the PGP libraries - many of them are straightforward...  

You didn't say what platform you need, but here are several links to get you started...

http://www.pgpi.org/

Here's the direct link to the PGP programming libs for C/C++

Hope this helps...

0
 
LVL 8

Expert Comment

by:akshayxx
ID: 8085024
see if this helps you...
http://web.comlab.ox.ac.uk/oucl/work/colin.percival/source/lib/rsa.html

quite close to what you need ..
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 8085044
forgot to tell that links to required sources and headers can be found one link UP

http://web.comlab.ox.ac.uk/oucl/work/colin.percival/source/lib/
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:akshayxx
ID: 8085182
did u try search on google
http://directory.google.com/Top/Science/Math/Applications/Communication_Theory/Cryptography/Programming_Libraries/


another link to a library that will give you RSA and a lot of other cryptographic tools

http://www.cs.auckland.ac.nz/~pgut001/cryptlib/


this  (http://mcrypt.hellug.gr/#_libmcrypt) i used to making tripwire-like host-based auditing tool..i used it for generating checksums of files on a unix/windows system .. which can be used to check if the files have been compromised by some hacker



i can post more links but u better have a look at the links on above directory.google link
ask if u have doubts for any specific library..

by the description and API-manual .. my first comment seems to fit in your needs
0
 

Author Comment

by:FlorianJaeger
ID: 8085465
akshayxx,

I think that's exactly what I was looking for. Please give me a some time to try it out and see if it works - but so far it looks very promising.

Thanks.
0
 
LVL 8

Accepted Solution

by:
akshayxx earned 800 total points
ID: 8085563
which one .. u r looking ..the first one ? if yes no need to comment back .. i'll take ur no comment as yes..
take ur time to figure out the working ..
by that time i'll also see it in my free time
0
 

Author Comment

by:FlorianJaeger
ID: 8088905
Yes I was talking about the first one.

Unfortunately I'm stalled. First it doesn't compile, I added it to a MFC project (all the required files) and included the "rsa.h" file and then called one of the functions from the RSA file.

When I compile it I get the message:

error LNK2001: unresolved external symbol "void __cdecl rsa_keygen(unsigned char *,unsigned char *,unsigned char *,unsigned int,unsigned char *)" (?rsa_keygen@@YAXPAE00I0@Z)
Release/RsaGui.exe : fatal error LNK1120: 1 unresolved externals

even though the rsa.obj file exists in the \Release directory.

I don't know if it's important but I switch the precompiled header feature off for this project since it wouldn't compile otherwise.

I don't understand ...
0
 

Author Comment

by:FlorianJaeger
ID: 8088948
Never mind, realized that I had to declare the function with "C" since it's a C function apparently.

extern "C" void rsa_keygen(uint8 * r,uint8 * pub,uint8 * priv,uint32 len,uint8 * T1);

Works now and maybe I'll figure it out how to even use it :-)
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 8089130
nice to know u r heading in positive direction..
0
 

Author Comment

by:FlorianJaeger
ID: 8106650
Thanks, the maintainer of the code was actually REALLY helpful in trying to help me.
0
 
LVL 8

Expert Comment

by:akshayxx
ID: 8107982
well then he deserves all the credit
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question