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

一般做网站seo运营是什么意思

一般做网站,seo运营是什么意思,生成器,天津市城乡建设部网站首页序 本文主要研究一下PBE算法 PBE PBE即Password Based Encryption,基于口令的加密,它是一种组合算法,即一般是哈希对称算法,比如PBEWithMD5AndDES,就是用MD5做哈希,用DES做加解密,而其密钥则…

本文主要研究一下PBE算法

PBE

PBE即Password Based Encryption,基于口令的加密,它是一种组合算法,即一般是哈希+对称算法,比如PBEWithMD5AndDES,就是用MD5做哈希,用DES做加解密,而其密钥则是口令+salt基于哈希函数计算而来

java示例

    public void testPBEWithIvParameter() throws NoSuchPaddingException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException {String algorithm = "PBEWithMD5AndDES";char[] passwd = "123456".toCharArray();PBEKeySpec pbeKeySpec = new PBEKeySpec(passwd);SecretKeyFactory kf = SecretKeyFactory.getInstance(algorithm);SecretKey key = kf.generateSecret(pbeKeySpec);byte[] salt = new byte[8];Random random = new Random();random.nextBytes(salt);Cipher cp = Cipher.getInstance(algorithm);IvParameterSpec iv = new IvParameterSpec(RandomUtil.randomBytes(16));PBEParameterSpec pbeParameterSpec = new PBEParameterSpec(salt, 1000, iv);cp.init(Cipher.ENCRYPT_MODE, key, pbeParameterSpec);byte[] data = "helloworld".getBytes(StandardCharsets.UTF_8);byte[] encrypted = cp.doFinal(data);System.out.println(Base64.encode(encrypted));Cipher cpDecrypt = Cipher.getInstance(algorithm);cpDecrypt.init(Cipher.DECRYPT_MODE, key, pbeParameterSpec);byte[] decryptBytes = cpDecrypt.doFinal(encrypted);System.out.println(new String(decryptBytes));}

几个参数,一个是口令,即passwd,一个是salt,随机盐值,一个是ivParameter

golang示例

func Encrypt(message string, password string, salt []byte) (string, error) {keyObtentionIterations := 1000md5key, iv := getMd5DerivedKey(password, salt, keyObtentionIterations)encrypted, err := desEncrypt([]byte(message), md5key, iv)if err != nil {return "", err}result := encryptedif includePlainIvInEncryptionResults() {result = append(iv, result...)}if includePlainSaltInEncryptionResults() {result = append(salt, result...)}return base64.StdEncoding.EncodeToString(result), nil
}

小结

  • PBE即Password Based Encryption,基于口令的加密,它是一种组合算法,即一般是哈希+对称算法,比如PBEWithMD5AndDES,就是用MD5做哈希,用DES做加解密,而其密钥则是口令+salt基于哈希函数计算而来
  • 当使用固定salt和不使用ivParameter的DES的时候,同一个值,每次加密生成的密文是一样的,而使用随机salt和随机iv的时候,每次生成的密文是不一样的,这个时候密文会包含随机的salt和iv信息,在解密的时候能够正确解出明文
http://www.yidumall.com/news/3091.html

相关文章:

  • 网站风格类型是快速网站轻松排名
  • 网站不接入备案企业网站推广
  • 阿里云增加网站软文范例500字
  • wordpress 5编辑器使用海阳seo排名
  • 做图的模板下载网站有哪些内容百度关键词购买
  • 利用access做网站百度商家平台客服电话
  • 贵州省建设部网站惠州seo外包公司
  • 杭州萧山网站建设公司seo推广软
  • 艺术学院网站建设整站优化 mail
  • 推荐网站建设话术长春网络优化哪个公司在做
  • 长沙手机网站建设哪些内容郑州全域静态管理
  • 一款可做引流的网站源码免费模式营销案例
  • 厦门站长优化工具软文广告范文
  • 三拼域名做网站seo优化排名营销
  • 自己做发小说网站解析域名网站
  • 中国联通 腾讯长沙优化排名
  • 企业网站带新闻发布功能的建站上海网络公司seo
  • 专门找事做的网站seo自动优化软件下载
  • 做网站公司法人还要拍照吗武汉seo百度
  • 娄底网站建设是什么网上做广告怎么收费
  • 快三网站开发网站生成app
  • 娄底做网站的公司搜索引擎优化的基本方法
  • 做网站流量赚钱成都百度搜索排名优化
  • 时间轴网页网站模板企业网
  • 中企动力是500强吗网页优化
  • 用wex5可以做网站吗长沙网站搭建关键词排名
  • 全球疫情最新数据表北京seo诊断
  • 优化网站排名茂名厂商google网页版入口
  • 公司做网站的费用属于什么费用seo外链
  • 钓鱼转转网站在线生成软件seo排名点击器曝光行者seo