sha256

how can I encode string in HMAC-SHA256 using pl/sql?

柔情痞子 提交于 2019-12-06 11:29:49
I'm working on REST API authorization in PL/SQL using Oracle database 11g Express Edition. I have api_key, nonce and signature as IN variables for every procedure. Signature is a HMAC-SHA256 encoded string containing api_secret stored in my database. I want check if signature matching my api_secret in database. My question is how can I encode string in HMAC-SHA256 using pl/sql? There is SHA256 PL/SQL Implementation for Oracle 10g,11g by CruiserX. Download the package from here . Compile the package and package body in sqlplus. Call the functions like this: SQL> select sha256.encrypt('test

Dual-sign .cat file has error “No signature was present in the subject”

南笙酒味 提交于 2019-12-06 06:43:47
问题 I'm dual-signing a windows .sys and .cat files for a driver using a certificate purchased from Symantec with the following command lines (the sys and cat files are both signed with the same options): signtool.exe sign /v /ph /n "MyCorp" /ac "C:\Signing\VeriSign Class 3 Public Primary Certification Authority - G5.cer" /i "VeriSign Class 3 Code Signing 2010 CA" /t "http://timestamp.verisign.com/scripts/timstamp.dll" "MyDriver.cat" signtool.exe sign /v /ph /n "MyCorp" /ac "C:\Signing\VeriSign

Cannot invoke initializer for type UnsafeMutablePointer<UInt8>

久未见 提交于 2019-12-06 06:18:46
问题 I'm trying to convert my string into SHA256 hash, but I get the next error: Cannot invoke initializer for type 'UnsafeMutablePointer<UInt8>' with an argument list of type '(UnsafeMutableRawPointer)' That's my function: func SHA256(data: String) -> Data { var hash = NSMutableData(length: Int(CC_SHA256_DIGEST_LENGTH))! if let newData: Data = data.data(using: .utf8) { let bytes = newData.withUnsafeBytes {(bytes: UnsafePointer<CChar>) -> Void in CC_SHA256(bytes, CC_LONG(newData.length),

Encrypt and Decrypt iOS/Node.js Security Inquiry

孤街醉人 提交于 2019-12-06 04:18:43
问题 I'm currently using AES128 on both platforms and my code from this answer Note: I changed the code a bit to deviate from using an IV because I thought it was overkill for the purpose of my application. node.js: var CryptoJS = require("crypto-js"); var crypto = require('crypto'); var password = "1234567890123456"; var salt = "gettingsaltyfoo!"; var hash = CryptoJS.SHA256(salt); var key = CryptoJS.PBKDF2(password, hash, { keySize: 256/32, iterations: 1000 }); var algorithm = 'aes128'; console

“Connection closed by peer” error occurs in Android 7.0 Nougat while connecting to SHA256 CA installed Windows 2003 Server SP2 through HTTPS

与世无争的帅哥 提交于 2019-12-06 03:02:40
问题 My app communicates with server interface (classic ASP) through HTTPS. It has been workd very well in prior version of Android 7.0 Nougat. (until 6.0) But, Connection closed by peer Error occurs in Android 7.0 phone and AVD(Android virtual device). Server is Windows 2003 Server SP2 (SSL Certificate was updated from SHA1 to SHA256 in Jul 23th, 2016), HTTPS, Classic ASP Server's SSL certificate installation check status of GeoTrust is like below (cryptoreport.geotrust.com/checker/views

[转帖]Proof Of Work 工作量证明

[亡魂溺海] 提交于 2019-12-06 01:33:23
Proof Of Work 工作量证明 https://www.cnblogs.com/zhang-qc/p/10451817.html 借鉴了 哈希现金(Hashcash)-1997年 英国密码学专家亚当.贝克(Adam Back) 用工作量证明系统解决了 互联网垃圾邮件问题 ,它要求计算机在获得发送信息权限之前做一定的计算工作,这对正常的信息传播来讲,几乎很难察觉,但是对向全网大量散步垃圾信息的计算机来说,就成为了巨大的工作量和负担。 通过进行一定的运算和消耗一定的时间来计算一个符合规则的值,并提供给服务方快速做验证。 比特币中的POW共识 比特币 - 去中心化的点对点电子交易系统 :维护分布式去中心化的账本 分布式无信任条件下的账本一致 ---》 共识 POW解决的是 拜占庭下的共识 ,保证分布式账本的最终一致性,解决双花攻击;同时也建立和维护了一个分布式的时钟 PoW系统的主要特征是 计算的不对称性 。(SHA256) 工作端需要做一定难度的工作得出一个结果,验证方却很容易通过结果来检查工作端是不是做了相应的工作。 作弊行为的前提在于花费大量的资源,一旦某人无法成功达成恶意目标就意味着其付出了巨大的且不可挽回的沉没成本。(这也是pow的优势所在,作恶有代价) 核心技术 :散列函数 SHA256 比特币节点pow大致流程: 生成coinbase交易

Is there a keyed SHA256 hash algorithm that is FIPS compliant for .NET?

自古美人都是妖i 提交于 2019-12-06 00:19:25
I am creating a keyed SHA256 hash using HMACSHA256 with the following code: HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secretKey); byte[] hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(data)); string hashResult = string.Empty; for (int i = 0; i < hash.Length; i++) { hashResult += hash[i].ToString("x2"); // hex format } This is working just fine, however, it fails in a FIPS enabled environment because HMACSHA256 uses an underlying SHA256Managed implementation which is itself not FIPS compliant. Searching through MSDN documentation I find that the only SHA256 implementation of

Calculating a hash code for a large file in parallel

我的未来我决定 提交于 2019-12-05 20:19:40
问题 I would like to improve the performance of hashing large files, say for example in the tens of gigabytes in size. Normally, you sequentially hash the bytes of the files using a hash function (say, for example SHA-256, although I will most likely use Skein, so hashing will be slower when compared to the time it takes to read the file from a [fast] SSD). Let's call this Method 1. The idea is to hash multiple 1 MB blocks of the file in parallel on 8 CPUs and then hash the concatenated hashes

20个Docker Command

让人想犯罪 __ 提交于 2019-12-05 18:50:40
在这之前呢,也写过两篇关于Docker基础入门类的文章 Docker容器技术入门(一) Docker容器技术入门(二) 很多人都感觉这文章这么简单、这么基础,可是别忘记了“万丈高楼平地起”,如果少了这个平地址,你这高楼估计也起不了。所以,基础是学习任何一门技术或者一个技术点的重中之重,也可以说是很关键的决胜点。 所以呢,今天,给大家 总结了这20个Docker Command,愿各位小伙伴在通往“玩转Docker”路上不再无助!!!! 安装完成docker容器服务之后,需要了解如何操作它?在shell命令行下直接输入docker就可以查看帮助信息,如下。 [root@master ~]# docker Usage: docker COMMAND A self-sufficient runtime for containers Options: --config string Location of client config files (default "/root/.docker") -D, --debug Enable debug mode --help Print usage -H, --host list Daemon socket(s) to connect to (default []) -l, --log-level string Set the logging

Encryption in nodejs

三世轮回 提交于 2019-12-05 17:44:27
问题 I'm trying to port the following php code to javascript on node.js: $mac = hash_hmac('SHA256', 'string', 'secret', true); $coded = base64_encode($mac); I've tried the following: var Crypto = require('crypto'); var code = Crypto.util.bytesToBase64(Crypto.HMAC(Crypto.SHA256, 'string', 'secret', { asBytes: true })); I get the error: TypeError: Object #Object has no method 'HMAC' I'm new to node.js, what am I doing wrong? Update: var code = Crypto.createHmac('SHA256', secret_key).update(to_encode