digest

base64 decode - nul in string

一个人想着一个人 提交于 2020-01-04 13:41:32
问题 I'm trying to create function that will run private API calls on some sites. All those sites are using authentication by signature of the API call as follows in php: base64_encode( hash_hmac('sha512', $post_data, base64_decode($secret), true) ) Using package digest and RCurl I can easily write as: base64Encode( hmac(key = base64Decode(secret), object = post_data, algo = 'sha512', raw = TRUE) ) I'm fighting whole day with the hmac key parameter input: key = base64Decode(secret) The issue is

HTTPS & Digest Authentication

戏子无情 提交于 2019-12-25 10:53:32
问题 How to implement HTTPS with Digest Authentication in C#.Net? as per msdn, credential class has no support for SSL.. so how can we implement authentication? my code works with basic authentication but gives error with digest.. 回答1: You can specify the type of credential when creating a credential in the CredentialCache, which is used for WebClients and WebRequests. So, for example, to populate the CredentialCache to try Digest auth you could use CredentialCache cache = new CredentialCache();

HTTPS & Digest Authentication

我的未来我决定 提交于 2019-12-25 10:53:23
问题 How to implement HTTPS with Digest Authentication in C#.Net? as per msdn, credential class has no support for SSL.. so how can we implement authentication? my code works with basic authentication but gives error with digest.. 回答1: You can specify the type of credential when creating a credential in the CredentialCache, which is used for WebClients and WebRequests. So, for example, to populate the CredentialCache to try Digest auth you could use CredentialCache cache = new CredentialCache();

Difference in SHA512 between python hashlib and sha512sum tool

為{幸葍}努か 提交于 2019-12-23 08:58:21
问题 I am getting different message digests from the linux 'sha512sum' tool and the python hashlib library. Here is what I get on my Ubuntu 8.10: $ echo test | sha512sum 0e3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123 - $ python Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import hashlib >>> hashlib.sha512("test")

Apache Http Digest Authentication using Java

血红的双手。 提交于 2019-12-22 12:38:17
问题 I am currently working on a Java project and I can't get the http digest authentication working. I tried using the Apache website, but it didn't help. I have a site that requires HTTP digest authentication. DefaultHttpClient httpclient = new DefaultHttpClient(); String hostUrl = "http://somewebsite.com"; String postUrl = "http://somewebsite.com/request"; HttpPost httpPost = new HttpPost(postUrl); String username = "hello"; String password = "world"; HttpHost targetHost = new HttpHost(hostUrl)

How to compute SHA1 of an array in Linux kernel

倖福魔咒の 提交于 2019-12-22 09:37:11
问题 I'm trying to compute SHA1 of an integer array in the Linux kernel. I have gone through crypto.c / crypto.h and security/integrity/ima/ima_crypto.c but I can't figure out how to init and then update the SHA1 computer. Can someone point me to a tutorial or guide on how to go about doing this? 回答1: There's a pretty good introduction to the linux cryptography api in Documentation/crypto/api-intro.txt. Also check out fs/ecryptfs/crypto.c for a real-life example of how the functions are used. Here

Best general-purpose digest function?

白昼怎懂夜的黑 提交于 2019-12-21 21:39:09
问题 When writing an average new app in 2009, what's the most reasonable digest function to use, in terms of security and performance? (And how can I determine this in the future, as conditions change?) When similar questions were asked previously, answers have included SHA1, SHA2, SHA-256, SHA-512, MD5, bCrypt, and Blowfish. I realize that to a great extent, any one of these could work, if used intelligently, but I'd rather not roll a dice and pick one randomly. Thanks. 回答1: I'd follow NIST/FIPS

C# Calculate and verify SHA256 value for SEPA (XML) paymentfile

前提是你 提交于 2019-12-21 20:24:40
问题 i am struggling with the same issue like Markus Dreyer: C# Calculate SHA256 value for SEPA (XML) paymentfile According to the DFÜ Agreement i have to calculate a sha256 hash value: The hash value is created using the entire contained document, including the opening and closing tag. The document is canonicalized according to Canonical XML, version 1.0. (http://www.w3.org/TR/2001/REC-xml-c14n-20010315). In the case of included documents, the canonisation has also to be executed accord-ing to

What are the chances that two messages have the same MD5 digest and the same SHA1 digest?

两盒软妹~` 提交于 2019-12-20 09:26:18
问题 Given two different messages, A and B (maybe 20-80 characters of text, if size matters at all), what is the probability that the MD5 digest of A is the same as the MD5 digest of B and the SHA1 digest of A is the same as the SHA1 digest of B? That is: (MD5(A) == MD5(B)) && (SHA1(A) == SHA1(B)) Assume no malicious intent, i.e., that the messages are not selected with an aim of finding a clash. I just want to know the odds of this happening naturally. I'm thinking the chances are "astronomically

Why doesn't my newly-created docker have a digest?

雨燕双飞 提交于 2019-12-19 02:42:22
问题 I have been following the Docker tutorial here, and built a test image on my local OSX machine by committing changes to an existing image and tagging it with three different labels: # docker images REPOSITORY TAG IMAGE ID CREATED SIZE adamatan/sinatra devel fccb6b4d21b4 8 minutes ago 469.5 MB adamatan/sinatra junk fccb6b4d21b4 8 minutes ago 469.5 MB adamatan/sinatra latest fccb6b4d21b4 8 minutes ago 469.5 MB However, none of these images has a digest: # docker images --digests adamatan