Wrox Programmer Forums
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 19th, 2004, 08:37 AM
Registered User
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default RSA

Hi, i've written a programme to decrypt rsa and it works fine for small values, for example when i chose my two primes to be 3 and 7 and therefore n=3*7=21 and totient function=12.

But i have to decrypt rsa with much larger primes, 167 and 233. So n=38911, totient function =38512
This means i have to calculate 18^8423 (mod(38911))!!
which is way too big for my computer to remember, isn't it?

i'm using double variables, what kind of variables would allow me to do this calculation?

Reply With Quote
  #2 (permalink)  
Old August 19th, 2004, 01:41 PM
Authorized User
Join Date: Feb 2004
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts

Well if you do some simple estimation, you can see that 18 to the power 8423 (which is what I think you mean by 18^8423) has a value of something like 10 to the 10573 (over 10000 decimal digits --- over 30000 bits). I think it is safe to say that no implementation of C that you are likely to have access to will have data types with this many bits. Therefore a simple calculation using built-in data types and operators is not likely.

You may find (on the web, using a search engine) C-language packages or libraries that have ways of manipulating arbitrarily large numbers (limited only by the amount of memory in your system). You may find ways of solving problems like this that use some algorithmic approach that doesn't require direct calculation of all quantities (but still require manipulation of large numbers).

Good Luck!!!!!!

Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrapping RSA Keys rayback_2 BOOK: Beginning Cryptography with Java 3 April 28th, 2008 04:29 PM
Problem With RSA Interface Floetic Java GUI 1 March 25th, 2008 06:14 AM
RSA and multiple block encryption chadmichael BOOK: Beginning Cryptography with Java 8 June 5th, 2007 03:51 AM
specification string for RSA cipher chadmichael BOOK: Beginning Cryptography with Java 3 January 23rd, 2007 07:31 PM
RSA Decryption - Chapter 4 amalvido BOOK: Beginning Cryptography with Java 2 January 22nd, 2007 08:59 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.