Solved

Long integers (preferably with source)

Posted on 1998-07-01
7
176 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

746 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

13 Experts available now in Live!

Get 1:1 Help Now