Solved

Long integers (preferably with source)

Posted on 1998-07-01
7
177 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 84

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 50 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
c++ array loading from DB inheriting previous data when empty 5 59
Load and store *.pnm image file 1 77
C++ assignment question 7 170
Getting IP address 8 71
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now