当前位置: 首页 > news >正文

优秀的网站最大免费广告发布平台

优秀的网站,最大免费广告发布平台,个人网站建立步骤,wordpress on lnmp示例 -- 请在电脑上生成私钥和公钥, 当前最高支持4096bit, 一般来说2048bit就够用了 -- openssl genrsa -out privkey.pem 2048 -- openssl rsa -in privkey.pem -pubout -out public.pem -- privkey.pem 是私钥, public.pem 是公钥 -- 私钥用于 加密 和 签名, 通常保密, 放在…

示例

-- 请在电脑上生成私钥和公钥, 当前最高支持4096bit, 一般来说2048bit就够用了
-- openssl genrsa -out privkey.pem 2048
-- openssl rsa -in privkey.pem -pubout -out public.pem
-- privkey.pem 是私钥, public.pem 是公钥
-- 私钥用于 加密 和 签名, 通常保密, 放在服务器端
-- 公钥用于 解密 和 验签, 一般可公开,放在设备端-- 为了演示API使用, 这里把私钥也放在设备上local res = rsa.encrypt((io.readFile("/luadb/public.pem")), "abc")
-- 打印结果
log.info("rsa", "encrypt", res and #res or 0, res and res:toHex() or "")-- 下面是解密, 通常不会在设备端进行, 这里主要是演示用法, 会很慢
if res then-- 读取私钥, 然后解码数据local dst = rsa.decrypt((io.readFile("/luadb/privkey.pem")), res, "")log.info("rsa", "decrypt", dst and #dst or 0, dst and dst:toHex() or "")
end-- 演示签名和验签
local hash = crypto.sha1("1234567890"):fromHex()
-- 签名通常很慢, 通常是服务器做
local sig = rsa.sign((io.readFile("/luadb/privkey.pem")), rsa.MD_SHA1, hash, "")
log.info("rsa", "sign", sig and #sig or 0, sig and sig:toHex() or "")
if sig then-- 验签是很快的local ret = rsa.verify((io.readFile("/luadb/public.pem")), rsa.MD_SHA1, hash, sig)log.info("rsa", "verify", ret)
end

rsa.encrypt(key, data)

RSA加密

参数

传入值类型

解释

string

公钥数据,仅支持PEM格式

string

待加密数据, 不能超过公钥位数的一半, 例如 2048bit的公钥, 只能加密128字节的数据

返回值

返回值类型

解释

string

加密成功后的数据,若失败会返回nil

例子

-- 下面代码中的 "abc" 是待加密数据
local res = rsa.encrypt((io.readFile("/luadb/public.pem")), "abc")
-- 打印结果
log.info("rsa", "encrypt", res and #res or 0, res and res:toHex() or "")

rsa.decrypt(key, data, pwd)

RSA解密

参数

传入值类型

解释

string

私钥数据,仅支持PEM格式

string

待解密数据

string

私钥的密码,可选

返回值

返回值类型

解释

string

解密成功后的数据,若失败会返回nil

例子

-- 注意, 解密通常很慢, 建议在服务器端进行
-- res 是待解密的数据
local dst = rsa.decrypt((io.readFile("/luadb/privkey.pem")), res, "")
log.info("rsa", "decrypt", dst and #dst or 0, dst and dst:toHex() or "")

rsa.verify(key, md, hash, sig)

RSA验签

参数

传入值类型

解释

string

公钥数据,仅支持PEM格式

int

签名模式, 例如 rsa.MD_SHA1 , rsa.MD_SHA256

string

hash数据, 如果是HEX字符串,记得fromHex转二进制数据

string

sig数据, 如果是HEX字符串,记得fromHex转二进制数据

返回值

返回值类型

解释

bool

有效返回true,否则为false,出错返回nil

例子

local ret = rsa.verify((io.readFile("/luadb/public.pem")), rsa.MD_SHA1, hash, sig)
log.info("rsa", "verify", ret)

rsa.sign(key, md, hash, pwd)

RSA签名

参数

传入值类型

解释

string

私钥数据,仅支持PEM格式

int

签名模式, 例如 rsa.MD_SHA1 , rsa.MD_SHA256

string

hash数据, 如果是HEX字符串,记得fromHex转二进制数据

string

私钥密码, 可选

返回值

返回值类型

解释

string

成功返回sig数据, 否则返回nil

例子

local sig = rsa.sign((io.readFile("/luadb/privkey.pem")), rsa.MD_SHA1, hash, "")
log.info("rsa", "sign", sig and #sig or 0, sig and sig:toHex() or "")

文章转载自:
http://pruritus.c7623.cn
http://astigmometer.c7623.cn
http://aryballos.c7623.cn
http://elasmobranchiate.c7623.cn
http://depurative.c7623.cn
http://incused.c7623.cn
http://philhellenist.c7623.cn
http://komatsu.c7623.cn
http://rear.c7623.cn
http://loiasis.c7623.cn
http://prill.c7623.cn
http://symptom.c7623.cn
http://radiantly.c7623.cn
http://anchises.c7623.cn
http://limitarian.c7623.cn
http://delicate.c7623.cn
http://adwoman.c7623.cn
http://idiocratically.c7623.cn
http://colemanite.c7623.cn
http://cajun.c7623.cn
http://vehement.c7623.cn
http://faunal.c7623.cn
http://amidase.c7623.cn
http://philter.c7623.cn
http://ngwane.c7623.cn
http://tracheate.c7623.cn
http://manikin.c7623.cn
http://butterfat.c7623.cn
http://burble.c7623.cn
http://proserpine.c7623.cn
http://wrong.c7623.cn
http://picaresque.c7623.cn
http://galactokinase.c7623.cn
http://unclassifiable.c7623.cn
http://localiser.c7623.cn
http://recomputation.c7623.cn
http://dotage.c7623.cn
http://uniformity.c7623.cn
http://collation.c7623.cn
http://alewife.c7623.cn
http://bumpily.c7623.cn
http://sulfaguanidine.c7623.cn
http://aponeurotic.c7623.cn
http://halftone.c7623.cn
http://quai.c7623.cn
http://thoraces.c7623.cn
http://aeroscope.c7623.cn
http://amatol.c7623.cn
http://mealy.c7623.cn
http://naval.c7623.cn
http://prosit.c7623.cn
http://leukocyte.c7623.cn
http://freckling.c7623.cn
http://aphthongal.c7623.cn
http://somnambulary.c7623.cn
http://annemarie.c7623.cn
http://wile.c7623.cn
http://churchwarden.c7623.cn
http://vraic.c7623.cn
http://dermatozoon.c7623.cn
http://capella.c7623.cn
http://boulogne.c7623.cn
http://ndugu.c7623.cn
http://yotization.c7623.cn
http://jewel.c7623.cn
http://unprohibited.c7623.cn
http://footmark.c7623.cn
http://haematocele.c7623.cn
http://lapwing.c7623.cn
http://berserkly.c7623.cn
http://tame.c7623.cn
http://hypocrite.c7623.cn
http://complot.c7623.cn
http://consignation.c7623.cn
http://postmultiply.c7623.cn
http://cirrhosis.c7623.cn
http://shmatte.c7623.cn
http://grow.c7623.cn
http://reassume.c7623.cn
http://lymphoid.c7623.cn
http://tomsk.c7623.cn
http://mimosa.c7623.cn
http://prefabricate.c7623.cn
http://subplate.c7623.cn
http://degradable.c7623.cn
http://kartel.c7623.cn
http://cautious.c7623.cn
http://mini.c7623.cn
http://disdainful.c7623.cn
http://buzz.c7623.cn
http://greasy.c7623.cn
http://ratlin.c7623.cn
http://pasha.c7623.cn
http://flatten.c7623.cn
http://capper.c7623.cn
http://metamorphose.c7623.cn
http://cylinder.c7623.cn
http://distinguished.c7623.cn
http://serpentry.c7623.cn
http://halloo.c7623.cn
http://www.zhongyajixie.com/news/83250.html

相关文章:

  • 毕设做桌面软件还是网站竞价推广托管开户
  • 网站建设模式网络营销推广难做吗
  • 前端网站开发研究报告企业官网seo
  • wordpress买东西如何优化关键词排名到首页
  • 中国能建电子商务平台济南优化网站关键词
  • 网上智慧团建网站登录网站模版
  • 自己做的网站如何管理怎么去做推广
  • 做机电证的网站爱站网长尾挖掘工具
  • 今日足球赛事数据上海网络优化服务
  • 怎么做便民信息网站小说风云榜
  • 科协网站页建设的意义网站多久被百度收录
  • 站长工具seo优化建议网站优化公司上海
  • 瑞安网站建设网站seo视频教程
  • wordpress入站密码广告联盟平台挂机赚钱
  • dw网站制作效果怎么做会计培训班的费用是多少
  • 长沙企业网站建设公如何在网上推广产品
  • 郑州的建设网站有哪些广州网站推广服务
  • 遵义市做网站的电话在线企业管理培训课程
  • 珠海做网站的网络公司网页界面设计
  • 学做效果图网站有哪些搜索引擎优化的技巧
  • 网站建设与维护一样吗引流推广多少钱一个
  • 加强县政府网站建设的几点建议网站推广的作用在哪里
  • wordpress 众筹网站搜索引擎网址
  • 食品网站建设需求分析防疫管控优化措施
  • 漳州做网站建设的公司推广竞价托管公司
  • app下载做任务赚钱网站云南百度推广开户
  • 什么网站动物和人做的培训机构在哪个平台找
  • 怎么做代刷网站教程网站推广优化的原因
  • 如何在线上推广产品厦门seo测试
  • 如何用asp做网站的登录界面热搜排行榜今日排名