1. 程式人生 > >基於私鑰加密公鑰解密的RSA演算法C#實現

基於私鑰加密公鑰解密的RSA演算法C#實現

{
                                
if (len >=128)
                                        blockLen
=128;
                                
else
                                        blockLen
= len;
                                block
= source.Substring(i *128, blockLen);
                                
byte[] oText = System.Text.Encoding.Default.GetBytes(block);
                                BigInteger biText
=new BigInteger(oText);
                                BigInteger biEnText
= biText.modPow(d, n);
                                
string temp1 = biEnText.ToHexString();
                                temp
+= temp1;
                                len
-= blockLen;
                        }