digest

HTTP Digest Authentication versus SSL

不羁的心 提交于 2019-11-28 08:09:54
What is the difference between HTTP Digest Authentication and SSL from a performance, security and flexibility point of view? The pros and cons of HTTP Digest Authentication are explained quite clearly in the Wikipedia article on the topic -- you should read that! To put it bluntly: HTTP Digest Auth will only protect you from losing your cleartext password to an attacker (and considering the state of MD5 security, maybe not even that). It is however wide open to Man-in-the-Middle attacks and also -- depending on the implementation, since most of the advanced features are optional -- replay,

HttpClient 4.1.1 returns 401 when authenticating with NTLM, browsers work fine

陌路散爱 提交于 2019-11-27 22:20:13
I'm trying to use the Apache/Jakarta HttpClient 4.1.1 to connect to an arbitrary web page using the given credentials. To test this, I have a minimal install of IIS 7.5 on my dev machine running where only one authentication mode is active at a time. Basic authentication works fine, but Digest and NTLM return 401 error messages whenever I try to log in. Here is my code: DefaultHttpClient httpclient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); HttpGet httpget = new HttpGet("http://localhost/"); CredentialsProvider credsProvider = new BasicCredentialsProvider();

get back a string representation from computeDigest(algorithm, value) byte[]

大城市里の小女人 提交于 2019-11-27 14:07:28
The Google App Script function computeDigest returns a byte array of the signature. How can I get the string representation of the digest? I have already tried the bin2String() function. function sign(){ var signature = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, "thisisteststring") Logger.log(bin2String(signature)); } function bin2String(array) { var result = ""; for (var i = 0; i < array.length; i++) { result += String.fromCharCode(parseInt(array[i], 2)); } return result; } but it puts "" in the Logs Mogsdad If we put Logger.log(signature); right after the call to computeDigest()

How can I calculate the SHA-256 hash of a string in Android?

99封情书 提交于 2019-11-27 09:58:22
问题 I'm trying to get the SHA256 of a string in Android. Here is the PHP code that I want to match: echo bin2hex(mhash(MHASH_SHA256,"asdf")); //outputs "f0e4c2f76c58916ec258f246851bea091d14d4247a2fc3e18694461b1816e13b" Now, in Java, I'm trying to do the following: String password="asdf" MessageDigest digest=null; try { digest = MessageDigest.getInstance("SHA-256"); } catch (NoSuchAlgorithmException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } digest.reset(); try { Log.i(

Sign PDF using an external service and iText

╄→尐↘猪︶ㄣ 提交于 2019-11-27 07:56:45
问题 I have this scenario. I have an application that generates a PDF, and that needs to be signed. We have not the certificates to sign the document, because they're in a HSM, and the only way we could make use of the certificates is using a webservice. This webservice, offers two options, send the PDF document, and it returns a signed pdf, or send a hash that will be signed. The first option, is not viable, because the PDF is signed without a timestamp (this is a very important requisite), so

HttpClient 4.1.1 returns 401 when authenticating with NTLM, browsers work fine

不想你离开。 提交于 2019-11-27 04:34:43
问题 I'm trying to use the Apache/Jakarta HttpClient 4.1.1 to connect to an arbitrary web page using the given credentials. To test this, I have a minimal install of IIS 7.5 on my dev machine running where only one authentication mode is active at a time. Basic authentication works fine, but Digest and NTLM return 401 error messages whenever I try to log in. Here is my code: DefaultHttpClient httpclient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); HttpGet httpget =

Insert hidden digest in pdf using iText library

元气小坏坏 提交于 2019-11-27 03:51:32
问题 I search a method for insert a digest (byte array or String) into PDF file using iText library (Java). I create the digest from a String with this method: private String crypt(double x, ByteArrayOutputStream baos) throws UnsupportedEncodingException, NoSuchAlgorithmException{ MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(String.valueOf(x).getBytes("UTF-8")); md.update(String.valueOf(baos).getBytes("UTF-8")); byte[] digest = md.digest(); StringBuffer sb = new StringBuffer(

HTTP Digest Authentication versus SSL

人走茶凉 提交于 2019-11-27 02:06:30
问题 What is the difference between HTTP Digest Authentication and SSL from a performance, security and flexibility point of view? 回答1: The pros and cons of HTTP Digest Authentication are explained quite clearly in the Wikipedia article on the topic -- you should read that! To put it bluntly: HTTP Digest Auth will only protect you from losing your cleartext password to an attacker (and considering the state of MD5 security, maybe not even that). It is however wide open to Man-in-the-Middle attacks

How can I do digest authentication with HttpWebRequest?

蓝咒 提交于 2019-11-27 01:35:14
问题 Various articles (1, 2) I discovered make this look easy enough: WebRequest request = HttpWebRequest.Create(url); var credentialCache = new CredentialCache(); credentialCache.Add( new Uri(url), // request url "Digest", // authentication type new NetworkCredential("user", "password") // credentials ); request.Credentials = credentialCache; However, this only works for URLs without URL parameters. For example, I can download http://example.com/test/xyz.html just fine, but when I attempt to

get back a string representation from computeDigest(algorithm, value) byte[]

痴心易碎 提交于 2019-11-26 18:22:16
问题 The Google App Script function computeDigest returns a byte array of the signature. How can I get the string representation of the digest? I have already tried the bin2String() function. function sign(){ var signature = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, "thisisteststring") Logger.log(bin2String(signature)); } function bin2String(array) { var result = ""; for (var i = 0; i < array.length; i++) { result += String.fromCharCode(parseInt(array[i], 2)); } return result; } but