Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sou…
using System; using System.Configuration; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using S…
php加密解密类 <?php class Aes{ private $key = '6b4d63211b4ba869'; private $iv = 'dbbf079b95004f65'; public function aes128_cbc_encrypt($data) { $key = $this->key; $iv = $this->iv; if(16 !== strlen($key)) $key = hash('MD5', $key, true); if(16 !== strle…
<?phpnamespace app;/** * 加密解密类 * 该算法仅支持加密数字.比较适用于数据库中id字段的加密解密,以及根据数字显示url的加密. * @author 深秋的竹子 * @version alpha * @加密原则 标记长度 + 补位 + 数字替换 * @加密步骤: * 将a-z,A-Z,0-9 62个字符打乱,取前M(数字最大的位数)位作为 标记长度字符串,取第M+1 到第M+10位为数字替换字符串,剩余的为补位字符串 * 1.计算数字长度n,取乱码的第n位作为标记长度…
Java常用的加密解密类 原文转载至:http://blog.csdn.net/wyc_cs/article/details/8793198 原创 2013年04月12日 14:33:35 1704 最近做一个项目,想到以前所有的项目在用户注册与登录及所有涉及用户自身隐私的信息进行提交到后台时都没有进行加密处理,甚至直接以明文方式在网络上传输,同时直接以明文的方式存到数据库中.所以想到需要先进行加密处理之后再进行网络传输,最后将加密后的数据存到数据库中,这样也可以增强系统的安全性. 对于加密与解…
生成二维码 /// <summary>/// 生成二维码/// </summary>public static class QRcodeUtils{private static string QrSaveUrl = "/img/QRcodeFile/"; /// <summary>///生成二维码/// </summary>/// <param name="QrContent">二维码内容</para…
原文:http://www.open-open.com/code/view/1420031154765 import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; /** * 文本文件加密解密类 * * 文件名:FileEncrypter.j…
import java.io.UnsupportedEncodingException; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; ///** AES对称加密解密类 **/ public class Aes { // /** 算法/模式/填充 **/ private static final String CipherMode = "AES/ECB/PKCS5Padding"; ///** 创…
一个java的des加密解密代码如下: //package com.visionsky.util; import java.security.*; //import java.util.regex.Pattern; //import java.util.Hashtable; import javax.crypto.*; import javax.crypto.spec.*; import sun.misc.*; /** * des加密解密 */ public class DESPlus { pr…
<?php class Mypass { static function encrypt($data, $key){ $key = md5($key); $x = 0; $len = strlen($data); $l = strlen($key); for ($i = 0; $i < $len; $i++){ if ($x == $l){ $x = 0; } $char .= $key{$x}; $x++; } for ($i = 0; $i < $len; $i++){ $str .…