sha1

How do a use a SecureString to create a SHA1 or SHA512 Hash?

若如初见. 提交于 2019-12-06 06:33:48
I would like to use a SecureString varible within VB.NET and convert that to a SHA1 or SHA512 hash. How would I securely convert the SecureString to the Byte array that HashAlgorithm.ComputeHash will accept? What about that, if we avoid the only used String instance (output) and replace it with a character array. This would enable us to wipe this array after use: public static String SecureStringToMD5( SecureString password ) { int passwordLength = password.Length; char[] passwordChars = new char[passwordLength]; // Copy the password from SecureString to our char array IntPtr passwortPointer =

How SHA and SHA1 certificates secure an API on your Android app like Facebook does?

馋奶兔 提交于 2019-12-06 04:21:40
I know what is a SHA and SHA1 cryptographic algorithm. I also know how to genarate these from a computer. But I have searched a lot on the internet and still unable to get a proper explanation on how using these keys will secure an API that you are using on an Android app? For example, Facebook needs your SHA1 key from your system along with your app's package name to be entered on their developer console and their API doesn't work on your app if the key you entered is wrong. How does this mechanism work? How do they verify this on your App? Facebook is leveraging Android application signing

hash function that works identically on ColdFusion MX7 and PHP 5.x?

你离开我真会死。 提交于 2019-12-06 02:45:45
I am working on a legacy ColdFusion MX7 site. They want to implement a "salted hash" password system. But some time in the next year or so they plan to build a completely new PHP site and don't want to have to reset (lose) all the passwords. So I'm looking for some code that will work on both platforms. I'm new to this, but as far as I can tell, the following two blocks of code should do the same thing. However, they produce different results. Anyone care to help? COLDFUSION CODE: <cffunction name="computeHash" access="public" returntype="String"> <cfargument name="password" type="string" />

PHP - MD5, SHA, Hashing security

守給你的承諾、 提交于 2019-12-06 02:05:00
问题 I'm the developer of a new website built in PHP and I'm wondering what exactly is the best thing to use for hashing. I've looked at md5 and sha1 but is there anything more secure. I'm sorry if this is a nooby question but I'm new to PHP Security and I'm trying to make my site as secure as possible. Also what is a salt? Thanks, Waseem 回答1: First off md5 and sha1 have been proven to be vunrable to collision attacks and can be rainbow tabled easily (When they see if you hash is the same in their

Changing the certificate fingerprint for an existing application

故事扮演 提交于 2019-12-06 01:29:39
I have an existing application that i published in to google play. All was fine, until I have changed a computer and my sha1 fingerprint changed. Is there a possible way to change the sha1 for an existing application in google play developer console? if not, how can I deal with it? Thank you! If you remember, when you publish the app first time on your older computer, you generate a key.keystore in order to sign the apk file and publish to google play. You need to have the same file. When you want to sign the apk, it asks if you want to generate a new key or use an existing key. Since you have

Convert SHA Hash Computation in Python to C#

左心房为你撑大大i 提交于 2019-12-06 00:59:59
问题 Can someone please help me convert the following two lines of python to C#. hash = hmac.new(secret, data, digestmod = hashlib.sha1) key = hash.hexdigest()[:8] The rest looks like this if you're intersted: #!/usr/bin/env python import hmac import hashlib secret = 'mySecret' data = 'myData' hash = hmac.new(secret, data, digestmod = hashlib.sha1) key = hash.hexdigest()[:8] print key Thanks 回答1: You could use the HMACSHA1 class to compute the hash: class Program { static void Main() { var secret

MS CryptoAPI doesn't work on Windows XP with CryptAcquireContext()

半城伤御伤魂 提交于 2019-12-05 20:19:14
I wrote some code using the Microsoft CryptoAPI to calculate a SHA-1 and got the compiled exe working on Windows 7, Win Server 2008, Win Server 2003. However, when I run it under Windows XP SP3, it does not work. I narrowed down the failure to the CryptAcquireContext() call. I did notice that a previous post talked about the XP faulty naming of " … (Prototype) " and it must be accounted for by using a WinXP specific macro MS_ENH_RSA_AES_PROV_XP. I did the XP specific code modifications and it still doesn't work. (The bResult returns 0 false on Win XP, all other platforms bResult returns 1 true

Optimise updating MD5/SHA1 with streams of zeros

笑着哭i 提交于 2019-12-05 17:43:32
Is it possible to optimise the function: MD5_Update(&ctx_d, buf, num); if you know that buf contains only zeros? Or is this mathematically impossible? Likewise for SHA1. If you control the input of the hash function then you could use a simple count instead of all the zero's, maybe using some kind of escape. E.g. 000020 in hex could mean 32 zero's. A (very) basic compression function may be much faster than MD5 or SHA1. Obviously this solution will only be faster if you save one or more blocks of hash calculations. E.g. it does not matter if you hash 3 bytes or 16 bytes, as the input will be

What is SHA1 fingerprint?

自闭症网瘾萝莉.ら 提交于 2019-12-05 17:42:40
问题 I am obtaining a Google Play API key from Google, and it is asking to enter SHA1 fingerprint. I want to know what is SHA1 fingerprint? I also wanted to know weather this API key can be used from another computer/pc? 回答1: It is a standard for the implementation of a 'secure hash algorithm' - a one-way cryptographic function that can be used to act as a 'signature' of a sequence of bytes. It is very unlikely that 2 different byte sequences would produce the same value (though not impossible)

HMACSHA1.ComputeHash() thread-safety question

有些话、适合烂在心里 提交于 2019-12-05 16:31:54
i am asking myself if it would be dangerous on a asp.net page´s codebehind to use an static (Shared) variable which holds an HMACSHA1-instance. the problem is that the same HMACSHA1-instance would be used by all the asp.net worker-process´ threads when processing multiple simultaneous requests on the same asp.net-page. all (HMACSHA1)instance- and ComputeHash()-method variables which are used/modified by ComputeHash() would be shared (= could be modified) by all the threads?! is that assumption correct? as a result the return value of ComputeHash would not be guaranteed to be correct?!?! thus i