Solved

Long integers (preferably with source)

Posted on 1998-07-01
7
182 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
[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
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
Industry Leaders: 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

Industry Leaders: 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!

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

691 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