# RSA **Repository Path**: china_chenyang/rsa ## Basic Information - **Project Name**: RSA - **Description**: 使用GOlang语言实现非对称加密密钥生成,通过该工具可以对数据进行加密和解密,只要你有足够的内存不限制数据的大小。 - **Primary Language**: Go - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-23 - **Last Updated**: 2022-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: RSA, 加密 ## README ### 使用说明 #### 安装 使用`go build RSA.go`编译,Linux平台生成RSA可执行文件,Windows平台生成RSA.exe可执行文件。 #### 打印帮助信息 ``` ./RSA -h Usage of RSA: -bs string 密钥bit长度 -cipf string 密文文件名 -plaf string 明文文件名 -plas string 明文字符串 -pukf string 指定要生成(或使用)公钥钥文件名 -pvkf string 指定要生成(或使用)私钥文件名 ``` #### 生成密钥 ``` ./RSA -bs 2048 -pvkf privatekey.pem -pukf publickey.pem ``` #### 根据已有的私钥文件生成公钥文件 ``` ./RSA -pvkf privatekey.pem -pukf publickey.pem ``` #### 加密明文文件,将加密后的数据输出到指定的文件 ``` ./RSA -pukf publickey.pem -plaf example.txt -cipf example.dat ``` #### 加密明文字符串,将加密后的数据输出到指定的文件 ``` ./RSA -pukf publickey.pem -plas 你好 -cipf example.dat ``` #### 解密加密文件,将解密后的明文输出到指定的文件 ``` ./RSA -pvkf privatekey.pem -cipf example.dat -plaf example.txt ``` #### 解密加密文件,将解密后的明文输出到屏幕 ``` ./RSA -pvkf privatekey.pem -cipf example.dat ```