45 lines
1.7 KiB
C#
45 lines
1.7 KiB
C#
namespace WinFormsApp6
|
|
{
|
|
internal static class Program
|
|
{
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
//string text = OcrSafeHelper.ReadText(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG");
|
|
//string text = OcrFinalHelper.RecognizeScreenshot(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG");
|
|
|
|
//string text = OcrLightGrayHelper.RecognizeLightGrayText(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG");
|
|
string text = OcrFinalHelper.RecognizeScreenshot(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG");
|
|
Console.WriteLine("识别结果:" + text);
|
|
|
|
RSA rSA = new RSA();
|
|
//公钥
|
|
string pubkey = rSA.ToPEM_PKCS1(true);
|
|
//私钥
|
|
string priKey = rSA.ToPEM_PKCS1();
|
|
//公钥加密
|
|
RSA rrSA = new RSA(pubkey, true);
|
|
string abc123=rrSA.Encode("abc123");
|
|
/*
|
|
前端公钥加密
|
|
let encrypt = new JSEncrypt();
|
|
encrypt.setPublicKey(key);
|
|
data.RsaUserPassword = encrypt
|
|
.encrypt(data.UserPassword + CryptoJS.MD5(state.LoginData.UserPassword))
|
|
.toString();
|
|
*/
|
|
//私钥解密
|
|
|
|
rrSA = new RSA(priKey, true);
|
|
string desc = rrSA.DecodeOrNull(abc123);
|
|
|
|
// To customize application configuration such as set high DPI settings or default font,
|
|
// see https://aka.ms/applicationconfiguration.
|
|
ApplicationConfiguration.Initialize();
|
|
Application.Run(new Form1());
|
|
}
|
|
}
|
|
} |