最近有个新项目用java做的,老项目是asp.net,接口传输需要des加解密,网上查了些资料,大多数不能拿来就用,自己经过调试加工了一下,具体代码如下: 密钥一定是8位 对应java的方法如下: package com.testspring; import javax.crypto.Cipher; ...
分类:
编程语言 时间:
2017-09-05 22:05:52
阅读次数:
244
package nsqdimport ( "bufio" "compress/flate" "crypto/tls" "fmt" "net" "sync" "sync/atomic" "time" "github.com/mreiferson/go-snappystream" "github.com... ...
分类:
其他好文 时间:
2017-08-31 12:58:58
阅读次数:
288
package nsqdimport ( "crypto/md5" "crypto/tls" "hash/crc32" "io" "log" "os" "time")type Options struct { // basic options ID int64 `flag:"worke... ...
分类:
其他好文 时间:
2017-08-31 12:43:49
阅读次数:
123
package nsqdimport ( "crypto/tls" "crypto/x509" "encoding/json" "errors" "fmt" "io/ioutil" "math/rand" "net" "os" "path" "runtime" "strings" "sync" "s... ...
分类:
其他好文 时间:
2017-08-31 12:41:31
阅读次数:
192
package http_apiimport ( "crypto/tls" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "net/url" "strconv" "strings" "time")type deadlinedConn struc... ...
package clientv3import ( "crypto/tls" "crypto/x509" "io/ioutil" "time" "github.com/coreos/etcd/pkg/tlsutil" "github.com/ghodss/yaml")type Config struc... ...
分类:
其他好文 时间:
2017-08-30 14:17:18
阅读次数:
177
package clientv3import ( "crypto/tls" "errors" "fmt" "net" "net/url" "strings" "time" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" prometheu... ...
分类:
其他好文 时间:
2017-08-30 14:11:46
阅读次数:
185
1.服务器端代码 #region 加密 /// <summary> /// 加密 /// </summary> /// <param name="Text"></param> /// <returns></returns> public static string Encrypt(string Te ...
import java.security.Key; import javax.crypto.Cipher; public class EncryptDecodeUtil { /** * 字符串默认键值 */ private static String strDefaultKey = "nationa... ...
分类:
其他好文 时间:
2017-08-20 15:54:42
阅读次数:
114
对于Random的使用,在业务中使用频率是非常高的,本文就小结下常用的方法: 在Golang中,有两个包提供了rand,分别为 "math/rand" 和 "crypto/rand", 对应两种应用场景。 一、"math/rand" 包实现了伪随机数生成器。也就是生成 整形和浮点型。 该包中根据生成 ...
分类:
其他好文 时间:
2017-08-19 17:05:33
阅读次数:
159