[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Long integers (preferably with source)

Posted on 1998-07-01
7
Medium Priority
?
198 Views
Last Modified: 2010-04-01
Hello,

I was just wondering if anyone could supply me the source code for a class or struct that allows you to implement long integers (say upwards of 20 digits).  A link to an internet site would be fine also.

I was wondering because I have an encryption program that I would like to make more secure by using long integers.  It currently uses 64 bit integers (__int64) but I would like it to be more secure than that.

Thank you very much.
0
Comment
Question by:thresher_shark
7 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 1167029
How about the GNU MP library?

By the way, what kind of encryption are you doing that uses 64 bit integers?
0
 
LVL 10

Accepted Solution

by:
rbr earned 150 total points
ID: 1167030
I can send you a program for integer of any size written in C. Send an email to rbr@physik.kfunigraz.ac.at
0
 
LVL 5

Expert Comment

by:yonat
ID: 1167031
There are long integer classes in many cryptographic libraries - see http://www.cs.hut.fi/crypto/software.html for pointers. My personal favorite (with a very good big integer class) is crypto++ from http://www.eskimo.com/~weidai/cryptlib.html .
0
Technology Partners: 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 2

Expert Comment

by:VEngineer
ID: 1167032
There are many long integer classes out there.  I guess C is cool but of course a C++ class is better than a C library because you can overload the operators which gives you more intuitive code.  If you want to write your own BigNum class (whole numbers with no definite limit), refer to Chapter 13 (Dynamic Data Types) of "C++ Program Design" by Cohoon and Davidson.  The code is all there in the text and it explains how it works and how to implement it too so you can customize it to your own needs.
0
 
LVL 2

Expert Comment

by:VEngineer
ID: 1167033
If you want a more advanced deal, definitely go with anything developed by GNU.  The source code is always provided too.
0
 
LVL 6

Author Comment

by:thresher_shark
ID: 1167034
rbr - I've sent you an email requesting the program.  It includes source code right?  The points will be awarded only if the program has the source code, otherwise, I'll have to reject it since yonat provided me with a great file.  Thanks.

ozo - Where do I get the GNU library?  Several people have mentioned it, but where do I get it?  Thanks.
      Also, I was just fiddling around with an algorithm I made.  I've never bothered getting any books on it, so I was just making one up as I went along.  It's not very secure, but I think it could be more so if I have larger integers.  It really doesn't matter that much since I'll probably never distribute it anywhere :-)

yonat - I downloaded the file you suggested.  It appears to be very comprehensive.  I haven't had time to look at it thouroughly, but I think it will be of great help.  Thank you very much.

VEngineer - Well, I guess the same goes for you as it does to ozo: Where do I get anything by GNU?  I haven't ever pursued it, so I don't know.  Thanks.
0
 
LVL 5

Expert Comment

by:yonat
ID: 1167035
For GNU stuff, see www.cygnus.com .
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

864 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