cryptography

How can i add more algorithm in cryptoAPI in linux

人盡茶涼 提交于 2019-12-21 20:24:32
问题 When i check /proc/crypto it shows me: abhi@ubuntu:/proc$ cat crypto name : stdrng driver : krng module : kernel priority : 200 refcnt : 1 selftest : passed type : rng seedsize : 0 name : md5 driver : md5-generic module : kernel priority : 0 refcnt : 1 selftest : passed type : shash blocksize : 64 digestsize : 16 I need to use aes256 for one of my projects. Can someone point out how I can add this algo to crypto api or is there any other way i can achieve this in (ubuntu 10.4, 2.6.32-35). Is

Node.js & Crypto: Store the current state of a crypto.createHash Instance to reuse it later

核能气质少年 提交于 2019-12-21 19:59:05
问题 How to store the current state of crypto.createHash('sha1') (after it got filled with hash.update(buffer) ) to use it at another http request which might occur at a different process of node.js? I imagine doing something like this: var crypto = require('crypto'), hash = someDatabase.read('hashstate') // continue with filled hash || crypto.createHash('sha1'); // start a new hash // update the hash someObj.on('data', function(buffer){ hash.update(buffer); }); someObj.on('end', function(){ //

crypto createHMAC output differs according to nodejs version

自作多情 提交于 2019-12-21 19:58:25
问题 I have issues with crypto module while upgrading my node version. The created HMAC depends on the version of node. You'll find below the piece of code that reproduces the problem. If I encode my key as BASE64 (or any) the HMAC does not depends on node.js version. If I encode it as binary, the HMAC is different if I change my node.js version. [EDIT] according to Why crypto.createHash returns different output in new version? I have added the encoding when calling the update function code

Issue decrypting with CommonCrypto in Swift

孤者浪人 提交于 2019-12-21 19:57:31
问题 I am working in a Swift-only crypt/decrypt Extension for String and NSData , and the crypt part is working based in the answer provided by @Zaph in the linked question: Issue using CCCrypt (CommonCrypt) in Swift The crypt output was tested using the good old NSData+AESCrypt.m Category in Objective-C I have been working in the decrypt part with an issue: The code compiles and runs fine, but the result is not the expected text originally encrypted. extension NSData { func

Creating Signed SOAP Message as a String with C#

有些话、适合烂在心里 提交于 2019-12-21 19:56:38
问题 I need to call web service that I have to send such soap request below by using C#. SoapBody and TimeStamp must be signed. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://xyzt.com/"> <soap:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:BinarySecurityToken EncodingType="http://docs

Creating Signed SOAP Message as a String with C#

三世轮回 提交于 2019-12-21 19:56:04
问题 I need to call web service that I have to send such soap request below by using C#. SoapBody and TimeStamp must be signed. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://xyzt.com/"> <soap:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:BinarySecurityToken EncodingType="http://docs

Android Key Invalidation when Fingerprints removed

跟風遠走 提交于 2019-12-21 19:25:11
问题 I'm testing on a Google Pixel device on 7.1.1 and finding that my Private Key isn't being invalidated when all fingerprints are removed from the device. I've tested using a single symmetric SecretKey as per the demo app and that worked as expected, however using an asymmetric key pair only throws a KeyPermanentlyInvalidatedException when new prints are enrolled, and not when they are all deleted. What's more, if I then enrol a new fingerprint, then show my fingerprint dialog and successfully

AES256 Encryption/Decryption in both NodeJS and C#

可紊 提交于 2019-12-21 17:34:43
问题 I've taken some liberties with the results of the following questions: AES encrypt in .NET and decrypt with Node.js crypto? Decrypting AES256 encrypted data in .NET from node.js - how to obtain IV and Key from passphrase C# version of OpenSSL EVP_BytesToKey method? And created the following class file... using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace T1.CoreUtils

PKCS#7 data payload unpacking with NodeJS?

不想你离开。 提交于 2019-12-21 17:19:44
问题 I'm working on an MDM NodeJS server for iOS. On the Apple docs, the following ruby code is given : p7sign = OpenSSL::PKCS7::PKCS7.new(req.body) store = OpenSSL::X509::Store.new p7sign.verify(nil, store, nil, OpenSSL::PKCS7::NOVERIFY) signers = p7sign.signers What would be the equivalent in NodeJS? The idea is to access p7sign.data that contains an xml plist. Is this possible using either crypto or an external node lib ( ursa , etc)? 回答1: A good option would be to use child_process to invoke

Cryptographic hash (sha1 or md5) of data given as a string in Mathematica

北战南征 提交于 2019-12-21 17:00:51
问题 The sha1 hash of "abc" is a9993e364706816aba3e25717850c26c9cd0d89d The only way to get Mathematica to tell you that with its Hash function is Hash[abc, "SHA"] // IntegerString[#, 16]& (The IntegerString thing is just to output it in hex like most implementations do.) Note that Hash["abc", "SHA"] gives the hash of "\"abc\"" -- not what you want! In fact, the only reason we could get the correct hash of "abc" was because the Mathematica representation of the symbol abc happens to be the string