sha1

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

坚强是说给别人听的谎言 提交于 2019-12-08 01:54:45
问题 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? 回答1: 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 =

Can I serialize a ruby Digest::SHA1 instance object?

久未见 提交于 2019-12-08 00:15:45
问题 G'day people, I am re-implementing an existent custom file upload service in ruby (sinatra) with redis as a backing store. Client calculates a SHA1 hash and initiates an upload uploads max 64K chunks until finished Server appends chunks to file calculates SHA1 hash of complete file to verify correct receipt Now, what I am hoping to do is use ruby (1.9.3) Digest::SHA1 << (update) operator on each chunk, (rather than having to read the ENTIRE file from scratch at the end). [Large files > 1GB].

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

我的未来我决定 提交于 2019-12-07 22:07:21
问题 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

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

删除回忆录丶 提交于 2019-12-07 13:48:25
问题 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

Optimise updating MD5/SHA1 with streams of zeros

眉间皱痕 提交于 2019-12-07 12:27:09
问题 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. 回答1: 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

How to get SHA-1 key in Android Studio 2.3.1?

不问归期 提交于 2019-12-07 09:48:38
问题 When I try gradle(Right corner): My_project: app: click on tasks: android: signingReport it doesn't give me any key or anything expected. I am not able to get SHA-1 key in Android Studio 2.3.1. I get this: Run build 761ms Run init scripts 23ms Configure settings 1ms Configure build 343ms Project : 343ms Resolve dependencies :classpath 331ms Calculate task graph 355ms Project :app 352ms Resolve dependencies :app:classpath 0ms Resolve dependencies :app:_debugApk 78ms Resolve dependencies :app:

HMACSHA1.ComputeHash() thread-safety question

左心房为你撑大大i 提交于 2019-12-07 07:41:46
问题 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

HMC SHA1 hash - C# producing different hash output than Ruby

旧街凉风 提交于 2019-12-07 06:27:16
问题 I'm trying to quickly get a buggy .Net client library for a third party service I'm using to work. The original library (which works) is written in Ruby, but their equivalent library for DotNet produces differing hash output to the Ruby library. The Ruby encryption code is as follows: def self.encrypt_string(input_string) raise Recurly::ConfigurationError.new("Recurly gem not configured") unless Recurly.private_key.present? digest_key = ::Digest::SHA1.digest(Recurly.private_key) sha1_hash = :

How to find SHA1 in Cordova project

我是研究僧i 提交于 2019-12-07 05:47:42
问题 So... I need to get a SHA1 key. I'm not a Java fan, so I'm creating my app in Cordova but I need the SHA1 to register it in Google's Developer Console. Does someone know where it is? I tried importing the project in Android studio but still couldn't find anything... 回答1: For Windows you have to create it using command prompt.First go to your java bin directory via the cmd like C:\Program Files\Java\jdk1.7.0_71\bin,then type keytool -list -v -keystore c:\users\your_user_name\.android\debug

How can I replicate this C# hashing in PHP? (toByteArray(), ComputeHash())

自作多情 提交于 2019-12-07 05:02:33
问题 I am trying to replicate the following code in PHP , It is example code for an API I have to interface with (The API & Example code is in C# , My app is in PHP 5.3 ). I'm not a C# developer and so am having trouble doing this. // C# Code I am trying to replicate in PHP var apiTokenId = 1887; var apiToken = "E1024763-1234-5678-91E0-T32E4E7EB316"; // Used to authenticate our request by the API (which is in C#) var stringToSign = string.Empty; stringToSign += "POST"+"UserAgent"+"http://api.com