Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


C# and large numbers ( crypto )

zappiszappis Member Posts: 1

I'm trying to do som cryptowork in c#. But I can't seem to find out how to use really big integers in c# (big meaning: 10^10000)

I know there are som buildt-in crypto features, but not the functions I want.

RSA cryptoscheme:
Ek(x) = x^b mod n
Dk(y) = y^a mod n
where x is plaintext to encrypt and y is ciphertext to decrypt

The thing is, the numbers (a,b,n)are really big primes (n > 100digits)

I am for the time beeing working around the problem by using the square-and-multiply function. But I still want to work with big numbers if I am to implment my own version of e.g. RSA, which require a primenumber-generator (and later in different systems a random-generator)

All in all:
I need large numbers to work in C#, so please help me.



  • chamsterchamster Member Posts: 662
    I think i understand your pain here. I haven't had need for such large numbers myself but a tip would be, maybe, constructing a class with a number of "smaller" variables as byte that together behave as a FLN.

    Kind Regards
    (+46/0) 708-70 73 92

  • chamsterchamster Member Posts: 662
    The bigger problem will araise if you want/need natives like long to be, how do i say that, longer... I'm not sure if it's possible.

    Kind Regards
    (+46/0) 708-70 73 92

  • Justin BibJustin Bib USAMember Posts: 0

    _ || || free ebooks and video tutorials about | Java, PL/SQL, Visual Basic, C#, Delphi, Perl, C++, JavaScript, PHP, Ruby, R, Scratch, Go, Assembly, MATLAB, Visual Basic .NET, Objective-C, Python, Swift, C Crystal, Logo, Lua, Dart, Fortran, VBScript, Alice, ABAP, Erlang, D, F#, Rust, SAS, Transact-SQL, Awk, ML, Scala, FoxPro, COBOL, Bash, Hack, LabVIEW, Apex, Julia, Clojure, Kotlin, Lisp, Prolog, Scheme, Ada | ____

Sign In or Register to comment.