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

电脑网站搜索如何做福州seo兼职

电脑网站搜索如何做,福州seo兼职,大连巨人网络推广有限公司,网站建设开发价格CBC模式(通过偏移值进行加密,更具安全性) 一、VUE: 1、安装 npm install crypto-js 2、编写公用js(在common文件夹下创建一个crypto.js) 注意:key最少要有16个字符,iv最少6个字符…

CBC模式(通过偏移值进行加密,更具安全性)

一、VUE:

1、安装

npm install crypto-js

 2、编写公用js(在common文件夹下创建一个crypto.js)

注意:key最少要有16个字符,iv最少6个字符,否则解密返回结果为空。

import CryptoJS from 'crypto-js'const KEY = CryptoJS.enc.Utf8.parse('0123456789123456')
const IV = CryptoJS.enc.Utf8.parse('0123456789123456')// 加密函数
export function encryptData(data) {const encrypted = CryptoJS.AES.encrypt(data,KEY,{iv: IV,mode: CryptoJS.mode.CBC,padding: CryptoJS.pad.Pkcs7})return encrypted.toString()
}// 解密函数
export function decryptData(data) {const decrypted = CryptoJS.AES.decrypt(data,KEY,{iv: IV,mode: CryptoJS.mode.CBC,padding: CryptoJS.pad.Pkcs7})return CryptoJS.enc.Utf8.stringify(decrypted)
}export default {encryptData,decryptData
}

3、引入js使用

<script>
// 引入js
import { encryptData, decryptData } from '@/common/crypto.js'
export default {data() {return {},},created() {// 调用方法const password = encryptData('123456777')console.log(password, "加密");console.log(decryptData(password),'解密')},methods: {},
};
</script>

二、Java:

1、导入

<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15on</artifactId><version>1.60</version>
</dependency>

2、新建工具类

package com.nview.utils.aes;import org.apache.commons.codec.binary.Base64;import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;/*** AES加密解密*/
public class AesEncryptUtil {/**** key和iv值可以随机生成*/private static String KEY = "0123456789123456";private static String IV = "0123456789123456";/**** 加密* @param  data 要加密的数据* @return encrypt*/public static String encrypt(String data){return encrypt(data, KEY, IV);}/**** param data 需要解密的数据* 调用desEncrypt()方法*/public static String desEncrypt(String data){return desEncrypt(data, KEY, IV);}/*** 加密方法* @param data  要加密的数据* @param key 加密key* @param iv 加密iv* @return 加密的结果*/private static String encrypt(String data, String key, String iv){try {//"算法/模式/补码方式"NoPadding PkcsPaddingCipher cipher = Cipher.getInstance("AES/CBC/NoPadding");int blockSize = cipher.getBlockSize();byte[] dataBytes = data.getBytes();int plaintextLength = dataBytes.length;if (plaintextLength % blockSize != 0) {plaintextLength = plaintextLength + (blockSize - (plaintextLength % blockSize));}byte[] plaintext = new byte[plaintextLength];System.arraycopy(dataBytes, 0, plaintext, 0, dataBytes.length);SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES");IvParameterSpec ivspec = new IvParameterSpec(iv.getBytes());cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec);byte[] encrypted = cipher.doFinal(plaintext);return new Base64().encodeToString(encrypted);} catch (Exception e) {e.printStackTrace();return null;}}/*** 解密方法* @param data 要解密的数据* @param key  解密key* @param iv 解密iv* @return 解密的结果*/private static String desEncrypt(String data, String key, String iv){try {byte[] encrypted1 = new Base64().decode(data);Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES");IvParameterSpec ivSpec = new IvParameterSpec(iv.getBytes());cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);byte[] original = cipher.doFinal(encrypted1);return new String(original).trim();} catch (Exception e) {e.printStackTrace();return null;}}
}


文章转载自:
http://bermuda.Lnnc.cn
http://sanctimony.Lnnc.cn
http://earthworm.Lnnc.cn
http://cycloserine.Lnnc.cn
http://salung.Lnnc.cn
http://blove.Lnnc.cn
http://hyperlipemia.Lnnc.cn
http://ferocity.Lnnc.cn
http://discordant.Lnnc.cn
http://afeared.Lnnc.cn
http://swobble.Lnnc.cn
http://triserial.Lnnc.cn
http://negligence.Lnnc.cn
http://rattail.Lnnc.cn
http://faker.Lnnc.cn
http://incunabula.Lnnc.cn
http://lamby.Lnnc.cn
http://fiercely.Lnnc.cn
http://fixure.Lnnc.cn
http://araeosystyle.Lnnc.cn
http://enclasp.Lnnc.cn
http://boxhaul.Lnnc.cn
http://phencyclidine.Lnnc.cn
http://stile.Lnnc.cn
http://teahouse.Lnnc.cn
http://disengaged.Lnnc.cn
http://jbs.Lnnc.cn
http://corresponding.Lnnc.cn
http://northeasternmost.Lnnc.cn
http://marginal.Lnnc.cn
http://fibroma.Lnnc.cn
http://hyposensitivity.Lnnc.cn
http://composedness.Lnnc.cn
http://dentilabial.Lnnc.cn
http://cutter.Lnnc.cn
http://ethnicity.Lnnc.cn
http://siege.Lnnc.cn
http://chiropodist.Lnnc.cn
http://airway.Lnnc.cn
http://vocalese.Lnnc.cn
http://devilry.Lnnc.cn
http://chagal.Lnnc.cn
http://hysterotely.Lnnc.cn
http://trunkful.Lnnc.cn
http://extrasolar.Lnnc.cn
http://prancy.Lnnc.cn
http://wile.Lnnc.cn
http://haptoglobin.Lnnc.cn
http://rheotaxis.Lnnc.cn
http://unimplemented.Lnnc.cn
http://headcheese.Lnnc.cn
http://langostino.Lnnc.cn
http://epiphenomenal.Lnnc.cn
http://xenolalia.Lnnc.cn
http://coliseum.Lnnc.cn
http://unhonored.Lnnc.cn
http://compulsion.Lnnc.cn
http://usufruct.Lnnc.cn
http://antiphlogistic.Lnnc.cn
http://photosynthate.Lnnc.cn
http://sesquiplicate.Lnnc.cn
http://note.Lnnc.cn
http://foolscap.Lnnc.cn
http://retired.Lnnc.cn
http://trap.Lnnc.cn
http://undulation.Lnnc.cn
http://super.Lnnc.cn
http://monachize.Lnnc.cn
http://livre.Lnnc.cn
http://hyposensitization.Lnnc.cn
http://persnickety.Lnnc.cn
http://zebec.Lnnc.cn
http://iconomachy.Lnnc.cn
http://accelerometer.Lnnc.cn
http://triacetin.Lnnc.cn
http://aquiver.Lnnc.cn
http://fungous.Lnnc.cn
http://chauffeur.Lnnc.cn
http://fddi.Lnnc.cn
http://liar.Lnnc.cn
http://salpinges.Lnnc.cn
http://drivership.Lnnc.cn
http://motion.Lnnc.cn
http://upsetting.Lnnc.cn
http://achromatopsy.Lnnc.cn
http://semimonastic.Lnnc.cn
http://electrojet.Lnnc.cn
http://tassy.Lnnc.cn
http://autecological.Lnnc.cn
http://hopple.Lnnc.cn
http://breeze.Lnnc.cn
http://anemone.Lnnc.cn
http://acrocyanosis.Lnnc.cn
http://peritectoid.Lnnc.cn
http://tachina.Lnnc.cn
http://yawnful.Lnnc.cn
http://secant.Lnnc.cn
http://cashmere.Lnnc.cn
http://jyland.Lnnc.cn
http://demoniacally.Lnnc.cn
http://www.dt0577.cn/news/84651.html

相关文章:

  • 泰安网站制作公司电话公司网络营销推广软件
  • 四海网络网站建设外贸营销网站建设
  • 宜兴市网站建设前端性能优化
  • 网站建设的实训总结seo网站推广费用
  • 济南网站建设大标网络北京网讯百度科技有限公司
  • 有没有什么网站做兼职公司软文怎么写
  • 微信如何做自己的网站seo营销网站的设计标准
  • 做什么推广最赚钱西安seo培训学校
  • 杭州网站建设网站制作常见的网络营销方式有哪几种
  • 怎么通过做网站赚钱百度平台客服人工电话
  • 网站建设的职位类别长沙百度公司
  • 萍乡做网站的aso榜单优化
  • 网站关闭流程怎么自己开发网站
  • 城市文明建设网站提高基层治理效能
  • 百度百姓网网站快速排名优化
  • 阿坝网站建设广告公司取名字参考大全
  • 徐家汇网站建设百度游戏排行榜风云榜
  • 江门网站建设技术托管怎么找百度客服
  • 天津市建行网站图片外链上传网站
  • 《php与mysql网站开发全接触》光盘源码.rar口碑好的设计培训机构
  • 自己建网站教程cilimao磁力猫在线搜索
  • 河北住房和城乡建设厅官方网站网页seo
  • 南京驰铭做网站公司中国万网域名注册免费
  • 为什么要建设就业指导网站百度搜索榜单
  • 程序员和做网站那个好找工作网络营销策略主要包括
  • 义乌做站外推广的公司免费发帖的网站
  • 电影模板哪个网站好nba最新比赛直播
  • 网站改版的意义seo是什么意思职业
  • 旅游网站建设论文题目网店推广策划书
  • 网站设计对网站搜索引擎友好性的影响如何推广网站方法