sha256

Encrypt and Decrypt iOS/Node.js Security Inquiry

一个人想着一个人 提交于 2019-12-04 11:31:14
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.log(key.toString(CryptoJS.enc.Base64)); function encrypt(text){ var cipher = crypto.createCipher

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

◇◆丶佛笑我妖孽 提交于 2019-12-04 10:05:29
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 Class 3 Public Primary Certification Authority - G5.cer" /i "Symantec Class 3 SHA256 Code Signing CA" /tr

signature with SHA256

一个人想着一个人 提交于 2019-12-04 09:59:27
I have a smartcard and I need to sign a file with this. That is a big problem as I see in stackover. I couldnt use RSACryptoServiceProvider, bkz it doesnt support RSA-SHA256 alogrithm. At First I used CAPICOM.dll , like code bellow, SignedData sed = new SignedData(); sed.Content = "a"; // data to sign Signer ser = new Signer(); ser.Certificate = cc; string singnn = sed.Sign(ser, false, CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64); But there isnt a public key to validate my signature value,, I couldnt get a validate key from capicom.dll. And after , I used X509Certificate2 , and

Cannot invoke initializer for type UnsafeMutablePointer<UInt8>

与世无争的帅哥 提交于 2019-12-04 09:30:41
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), UnsafeMutablePointer<UInt8>(hash.mutableBytes)) } } return hash as Data } so, for this part UnsafeMutablePointer

How to use HMAC in Lua - Lightroom plugin

♀尐吖头ヾ 提交于 2019-12-04 09:27:00
First thing I have to mention is I'm really really new to Lua and please be patient if you think my question is too dumb Here is my requirement I need to use HMAC-sha256 for Lightroom plugin development as I'm using that for security. I was trying to use this but with no luck https://code.google.com/p/lua-files/wiki/hmac These are the steps I followed Got the code of https://code.google.com/p/lua-files/source/browse/hmac.lua and saved as 'hmac.lua' file in my plugin directory Got the code from this https://code.google.com/p/lua-files/source/browse/sha2.lua and saved as 'sha2.lua' file Now in

“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-04 08:02:54
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/certCheck.jsp) GeoTrust check status screen shot of my Server's certificate (Protocols not enabled : TLS1.1,

使用docker搭建开发环境

情到浓时终转凉″ 提交于 2019-12-04 07:40:24
我的主力机是windows,windows下面有太多提升效率的软件.但是开发的时候不得不使用linux.就单单开发而言.我还是喜欢使用linux.所以就造成了我得在windows下面使用虚拟机.这是最开始的办法.后面得知有vagrant这个东西之后,用了一阵子感觉还不错.但是我使用的时候动不动就会出现一些问题,所以一怒之下决定学学docker.然后使用docker来作为开发环境. 使用docker作为开发环境大概我有这几点要求 部署快,不要换台机子装了一天的环境 稳定... 轻轻轻! container得可以访问本机所在局域网 可以实现文件共享 在我接触了一阵子docker之后,发现docker可以满足我大部分意淫出来的美好开发环境.折腾一番之后终于搞定,于是祭出本文.希望可以帮助到需要的人. 学习本篇之前希望你对docker有一丢丢的了解,一丢丢就可以了. 安装. 我一般不喜欢讲如何安装一个软件,但是介于docker的一些问题.还是讲讲. 如果是windows10之前的用户,那么安装docker比较麻烦. 你可能需要一个 Docker Toolbox 的东西,具体安装方式请自行google.因为我的机子是Windows10的. 如果你是Windows10的用户,恭喜你.你只要 点这里 下载一个exe文件,然后就可以无脑安装了.但是要保证开启 Hyper-V 功能.如何开启 看这里

Signed XML signature verification for SSO SAML (Using sha256)

↘锁芯ラ 提交于 2019-12-04 03:55:44
Using VS 2008 with .Net Framework 3.5 on windows 2003 server. We have implemented SSO with SAML for security. We work at service provider end where we validate the Signed XML SAML Assertuib token generated from client's system. As of now whatever signed documents we came across were using the Signature Algorithm "rsa-sha1", but now we have new customer who sends a file with the signature algorithm as "rsa-sha256" and here is the problem started. public static string VerifySignature() { if (m_xmlDoc == null) return "Could not load XMLDocument "; try { XmlNamespaceManager nsm = new

Calculating a hash code for a large file in parallel

吃可爱长大的小学妹 提交于 2019-12-04 02:52:32
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 into a single final hash. Let's call this Method 2. A picture depicting this method follows: I would like

Encryption in nodejs

烂漫一生 提交于 2019-12-04 02:33:18
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).digest('base64'); Tesserex You want to use the createHmac function instead. Crypto.createHmac("SHA256