rsa.h

来自「此文件是实现了使用rsa加密 可以加密图片、文本等」· C头文件 代码 · 共 31 行

H
31
字号
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<string>

using namespace std;




#define LENGTH 8 // p,q长度

void GenerateRSAKey( ) ;

void RSAEncrypt(  unsigned int key , unsigned int n ,string filename) ;
void RSADecrypt(  unsigned int key ,  unsigned int n ,string filename) ;



/////******/////*****/////****
  unsigned int GetPrim(  unsigned int a);
  unsigned int GetOdd(  unsigned int a);
bool SolovayStrassen(  unsigned int n,  unsigned int count) ; 
template <class T>
T Jacobi(T n, T a) ;
  unsigned int gcd(  unsigned int a,   unsigned int b);
  unsigned int Inverse(  unsigned int a,   unsigned int b);
  unsigned int SquareAndMultiply(  unsigned int  BaseNum,   unsigned int exponent,   unsigned int ModN);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?