本文整理汇总了Java中com.subgraph.orchid.crypto.TorStreamCipher类的典型用法代码示例。如果您正苦于以下问题:Java TorStreamCipher类的具体用法?Java TorStreamCipher怎么用?Java TorStreamCipher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TorStreamCipher类属于com.subgraph.orchid.crypto包,在下文中一共展示了TorStreamCipher类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CircuitNodeCryptoState
import com.subgraph.orchid.crypto.TorStreamCipher; //导入依赖的package包/类
private CircuitNodeCryptoState(byte[] keyMaterial, byte[] verifyDigest) {
checksumDigest = HexDigest.createFromDigestBytes(verifyDigest);
int offset = 0;
forwardDigest = new TorMessageDigest();
forwardDigest.update(extractDigestBytes(keyMaterial, offset));
offset += TorMessageDigest.TOR_DIGEST_SIZE;
backwardDigest = new TorMessageDigest();
backwardDigest.update(extractDigestBytes(keyMaterial, offset));
offset += TorMessageDigest.TOR_DIGEST_SIZE;
forwardCipher = TorStreamCipher.createFromKeyBytes(extractCipherKey(keyMaterial, offset));
offset += TorStreamCipher.KEY_LEN;
backwardCipher = TorStreamCipher.createFromKeyBytes(extractCipherKey(keyMaterial, offset));
}
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:18,代码来源:CircuitNodeCryptoState.java
示例2: createEntry
import com.subgraph.orchid.crypto.TorStreamCipher; //导入依赖的package包/类
private BasicAuthEntry createEntry(ByteBuffer bb) {
final byte[] id = new byte[BASIC_ID_LENGTH];
final byte[] skey = new byte[TorStreamCipher.KEY_LEN];
bb.get(id);
bb.get(skey);
return new BasicAuthEntry(id, skey);
}
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:HSAuthentication.java
示例3: decryptRemaining
import com.subgraph.orchid.crypto.TorStreamCipher; //导入依赖的package包/类
private byte[] decryptRemaining(ByteBuffer buffer, byte[] key, byte[] iv) {
TorStreamCipher streamCipher = TorStreamCipher.createFromKeyBytesWithIV(key, iv);
final byte[] remaining = new byte[buffer.remaining()];
buffer.get(remaining);
streamCipher.encrypt(remaining);
return remaining;
}
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:8,代码来源:HSAuthentication.java
示例4: extractCipherKey
import com.subgraph.orchid.crypto.TorStreamCipher; //导入依赖的package包/类
static private byte[] extractCipherKey(byte[] keyMaterial, int offset) {
final byte[] keyBytes = new byte[TorStreamCipher.KEY_LEN];
System.arraycopy(keyMaterial, offset, keyBytes, 0, TorStreamCipher.KEY_LEN);
return keyBytes;
}
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:6,代码来源:CircuitNodeCryptoState.java
示例5: decryptAuthEntry
import com.subgraph.orchid.crypto.TorStreamCipher; //导入依赖的package包/类
private byte[] decryptAuthEntry(BasicAuthEntry entry) throws HSAuthenticationException {
TorStreamCipher cipher = TorStreamCipher.createFromKeyBytes(cookie.getValue());
cipher.encrypt(entry.skey);
return entry.skey;
}
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:6,代码来源:HSAuthentication.java
注:本文中的com.subgraph.orchid.crypto.TorStreamCipher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论