Code covered by the BSD License  

Highlights from
big modulo function

3.66667

3.7 | 3 ratings Rate this file 12 Downloads (last 30 days) File Size: 1.49 KB File ID: #7908

big modulo function

by bennyboss

 

24 Jun 2005 (Updated 20 Jun 2009)

Computes modulo for large numbers.

| Watch this File

File Information
Description

Use this function if you need to compute modulo for large numbers (eg. RSA). This function is faster then the recursive one.

Tested in matlab's profiler on:

4448780^91884097(mod 961)

results:
- recursive function: 2.578 s
- this function: 0.016 s.

algorythm source:
http://www.disappearing-inc.com/ciphers/rsa.html

(this page does not exist any longer, but I saved it at that time and you'll find it in the zip file)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
big x^y modulo function

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
31 Dec 2005 saahil kumar

this one is really great it works....however i need decoding code also plz help using big modulo...plzz help me asap

04 Feb 2006 Pontus Nelldal  
11 Mar 2006 DJD k;j  
28 Jan 2012 krishkr

Easier this way->

a=java.math.BigInteger('4448780');
b=java.math.BigInteger('91884097');
c=java.math.BigInteger('961');
a.modPow(b,c)

A wrapper class is all that is needed to make them good looking :)

Please login to add a comment or rating.
Updates
20 Jun 2009

I've included the original algorithm page in the zip file. (becasue it does not exist any longer)

Tag Activity for this File
Tag Applied By Date/Time
modulo bennyboss 22 Oct 2008 07:51:11
rsa bennyboss 22 Oct 2008 07:51:11
large numbers bennyboss 22 Oct 2008 07:51:11
compute bennyboss 22 Oct 2008 07:51:11
fast bennyboss 22 Oct 2008 07:51:11

Contact us at files@mathworks.com