wangchao.org
添加收藏 | 博客
 
购物视频论坛IT业界自然风光美女图片王朝网络小游戏BT下载生活百科编程设计手机图铃小说
 
笑话 | 水库 | 娱乐 | 体育 | 英语 | 宠物 | 美食 | 旅游 | 养生 | 手机 | 数码 | 汽车 | 珠宝 | 美容 | 装修 | 厨房 | 科普 | 动物 | 植物 | 影音 | 百科 | 知道 | 词典
  
 
 您好! 您现在位于: 王朝网络 → 编程设计 → 《java版的SHA-1返回上一页 
 
1楼 

java版的SHA-1

  网上购物、在线购物、购物搜索 欢迎光临本站购买图书、影视、音乐、数码、百货,手机等商品。

  /**
  * <b>This Java Class consists the server side for the wondeful javascript library 'sha1.js'. I wrote it because I basically needed
  * some cheap client/server login authentication by the usual key/data system. Besides, I got the creeps watching the passWord
  * posted unencrypted via http requests. This class makes sure that if your client is using the 'sha1.js' to encrypt the password
  * with a key sent by the server, you can always repeat the encrypting on the server side (using the same key) and compare the
  * encrypted strings. Since anyone who is trapping the http requests can actually send you the same encrypted string, I suggest
  * you use the client's IP address as the base for the key generation. Since IP address spoofing is not a problem, this authentication
  * method is not a very secured solution. If you need a full proof solution use ssl. However, this one, sure beats nothing.
  * Feel free to do with it whatever you want</b>
  * <p><b>This Class is an Abstract Class, to make sure you do not create any new instances of it. It does not throw any exceptions and
  * the code is mUCh more 'C' like than pure object oriented. There are no implemented interfaces and no inheritance in use. In fact, it
  * is written as close as possible to the original javascript code. I did not test tweaking the instance variables but if you do change
  * them, make sure to apply the same change in the 'sha1.js' library or you won't get the same encrypted strings.
  * You can call each one of the 6 work methods by using something like: SHA1.hex_hmac_sha1("key", "data");
  * They are the only public methods. All are public and static. You have no reason to call the private ones anyway.</p></b>
  * <p>The 'sha1.js' is a javascript implementation of the Secure Hash Algorithm, SHA-1, as defined in FIPS PUB 180-1.
  * javascript Version 2.1 Copyright Paul Johnston 2000 - 2002. Other contributors to javascript version: Greg Holt,
  * Andrew Kepert, Ydnar, Lostinet Distributed under the BSD License</p>
  * <p>See <a href="http://pajhome.org.uk/crypt/md5">http://pajhome.org.uk/crypt/md5</a> for details.</p>
  * <p><b>Author: </b>T.N.Silverman (C.T.Xm - SiA Riga, LV) <a href="mailto:tnsilver@ctcm.com">mailto:tnsilver@ctxm.com</a>
  * <br>Creation date: (3/27/2004 5:57:00 PM)</p>
  * <p>Don't forget to visit my company, <b>CTXM</b> site at <a href="http://www.ctxm.com">http://www.ctxm.com</a> where you will find reference to all of the games this code is used in.

  /** * <b>This Java Class consists the server side for the wondeful javascript library 'sha1.js'. I wrote it because I basically needed * some cheap client/server login authentication by the usual key/data system. Besides, I got the creeps watching the passWord * posted unencrypted via http requests. This class makes sure that if your client is using the 'sha1.js' to encrypt the password * with a key sent by the server, you can always repeat the encrypting on the server side (using the same key) and compare the * encrypted strings. Since anyone who is trapping the http requests can actually send you the same encrypted string, I suggest * you use the client's IP address as the base for the key generation. Since IP address spoofing is not a problem, this authentication * method is not a very secured solution. If you need a full proof solution use ssl. However, this one, sure beats nothing. * Feel free to do with it whatever you want</b> * <p><b>This Class is an Abstract Class, to make sure you do not create any new instances of it. It does not throw any exceptions and * the code is mUCh more 'C' like than pure object oriented. There are no implemented interfaces and no inheritance in use. In fact, it * is written as close as possible to the original javascript code. I did not test tweaking the instance variables but if you do change * them, make sure to apply the same change in the 'sha1.js' library or you won't get the same encrypted strings. * You can call each one of the 6 work methods by using something like: SHA1.hex_hmac_sha1("key", "data"); * They are the only public methods. All are public and static. You have no reason to call the private ones anyway.</p></b> * <p>The 'sha1.js' is a javascript implementation of the Secure Hash Algorithm, SHA-1, as defined in FIPS PUB 180-1. * javascript Version 2.1 Copyright Paul Johnston 2000 - 2002. Other contributors to javascript version: Greg Holt, * Andrew Kepert, Ydnar, Lostinet Distributed under the BSD License</p> * <p>See <a href="http://pajhome.org.uk/crypt/md5">http://pajhome.org.uk/crypt/md5</a> for details.</p> * <p><b>Author: </b>T.N.Silverman (C.T.Xm - SiA Riga, LV) <a href="mailto:tnsilver@ctcm.com">mailto:tnsilver@ctxm.com</a> * <br>Creation date: (3/27/2004 5:57:00 PM)</p> * <p>Don't forget to visit my company, <b>CTXM</b> site at <a href="http://www.ctxm.com">http://www.ctxm.com</a> where you will find reference to all of the games this code is used in.

 
标签: java  SHA  版的  
 
您可以将本页贴到其他网站
UBB代码HTML代码
 
 
 
 
 
 
 更多内容
 ·java报表EXCEL解决方案 ·java版本名称 ·java版的MD5 ·JavaServer Faces (JSF) vs Stru
 ·JavaServer Faces 简介 ·JavaVM,反射与动态代理 ·javamail的几个实用知识点 ·JavaMail邮件主题乱码的解决方法
 ·javamail中使用发信身份验证 ·javaRMI使用入门程序及配置 ·Javadoc 利弊分析(from IBM) ·Java--ImageViewer
 ·javaCC学习笔记 ·JavaBean 设置关联属性 ·JavaBean调用示例(转) ·JavaBean与EJB的不同
 ·JavaCC的安装 ·Java的建造设计模式 ·Java的魔力:字节码 ·JAVA的动态编译和静态编译
 ·Java的Package与Import机制之我的 ·Java的产生 ·java的io系统 ·Java的Build工具—Ant应用指南(
 
 
最新评论  点此查看所有评论
 
 
 
 
发表评论(支持UBB码)


验证码:  
 
 
 
© 2005- 王朝网络 版权所有