index
inc/config
inc/config.bak
inc/wts
inc/class/cache
inc/class/cookie
inc/class/db
inc/class/error
inc/class/fso
inc/class/function
inc/class/js
inc/class/load
inc/class/log
inc/class/pagelist
inc/class/request
inc/class/response
inc/class/route
inc/class/session
inc/class/template
inc/class/valid
inc/class/crypt/a2u
inc/class/crypt/aes
inc/class/crypt/base64
inc/class/crypt/des
inc/class/crypt/escape
inc/class/crypt/hex
inc/class/crypt/md5
inc/class/crypt/num
inc/class/crypt/rsa
inc/class/crypt/sha
inc/class/ext/array
inc/class/ext/cart
inc/class/ext/date
inc/class/ext/http
inc/class/ext/jmail
inc/class/ext/jpeg
inc/class/ext/json
inc/class/ext/jsont
inc/class/ext/mail
inc/class/ext/md5
inc/class/ext/pack
inc/class/ext/stringbuilder
inc/class/ext/tqqwry
inc/class/ext/upfile
inc/class/ext/verify
inc/class/ext/webstat
inc/class/ext/wia
inc/class/ext/xml
inc/class/ext/zip
inc/class/route/module
inc/class/route/slash
inc/module/default/control/clear
inc/module/default/control/crypt <--
inc/module/default/control/error
inc/module/default/control/hello
inc/module/default/control/index
inc/module/default/control/json
inc/module/default/control/pic
inc/module/default/control/upload
inc/module/default/control/start/site
inc/module/default/control/start/route/key
inc/module/default/control/start/route/pic
inc/module/default/control/start/route/reg
inc/module/default/control/tag/hello
inc/module/default/language/cn/hello
inc/module/default/language/en/hello
inc/module/default/model/hello
inc/module/help/control/error
inc/module/help/control/index
inc/module/help/control/install
inc/module/help/control/start/site

类描述

title Control_Crypt
author ekede.com
date 2018-06-09
description 加密解密

类方法

Index_Action()

返回

md5演示
		Set c = loader.loadClass("Ext/Md5")
		    wts.responses.SetOutput "md5(""你好"") : "& c.MD5("你好",32) '中文不一致的问题
		Set c = Nothing
		
        
HMACMD5演示
	    Set h = loader.loadClass("Crypt/Hex")
        Set c = loader.loadClass("Crypt/Md5")
			wts.responses.SetOutput h.Bytes2Hex(c.MD5("你好"))
			wts.responses.SetOutput h.Bytes2Hex(c.HMACMD5("你好","123"))
		Set c = Nothing
		Set h = Nothing
		
        
HMACSHA1演示
	    Set h = loader.loadClass("Crypt/Hex")
        Set c = loader.loadClass("Crypt/Sha")
			wts.responses.SetOutput h.Bytes2Hex(c.SHA1("你好"))
			wts.responses.SetOutput h.Bytes2Hex(c.HMACSHA1("你好","123"))
		Set c = Nothing
		Set h = Nothing
		
        
Base64演示
        Set c = loader.loadClass("Crypt/Base64")
			x = c.Bytes2Base64(wts.fso.Str2Bytes("Str,二进制,Base64转换","utf-8"))
			wts.responses.SetOutput wts.fso.Bytes2Str(c.Base642Bytes(x),"utf-8")
		Set c = Nothing
		
        
RSA 演示
		'c# Rsa Key Format : PEM PKCS1 <-> PEM PKCS8 <-> C# xml key
		'privatekey_csharp = "xxx"
		Set r1= loader.loadClass("Crypt/Rsa")
			r1.Privatekey=privatekey_csharp
		   'r1.Publickey=publickey_csharp
			a="Hello WTS"
			b=r1.Encrypt(a)
			c=r1.Decrypt(b)
			d=r1.SignData(a,"SHA1")
			e=r1.VerifyData(a,"SHA1",d)
		Set r1 = Nothing