sha256

docker image常用的命令

纵然是瞬间 提交于 2019-11-28 13:54:50
查看镜像 [root@sds-1 ~]# docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE linuxserver/nginx latest dd9aa5a82e20 7 days ago 160MB mysql latest 62a9f311b99c 11 days ago 445MB [root@sds-1 ~]# 删除镜像 [root@sds-1 ~]# docker image rm mysql Untagged: mysql:latest Untagged: mysql@sha256:01cf53f2538aa805bda591d83f107c394adca8d31f98eacd3654e282dada3193 Deleted: sha256:62a9f311b99c24c0fde0a772abc6030bc48e5acc7d7416b8eeb72d3da1b4eb6c Deleted: sha256:82aa89ee850095559cbbee1f9d4bdaf06e21e42712b5d1a8a1904907433a1af3 Deleted: sha256:36d3209ee2d8a848f1e0e2ba5659478bbb0b0ca05384d18d4dd3b0672b4010a8 Deleted:

how to specify signature length for java.security.Signature sign method

爱⌒轻易说出口 提交于 2019-11-28 12:30:42
问题 For my application, I'm trying to sign some byte contents using java.security.Signature class. The problem I'm having is that signature is never generated at a fixed length. For instance, sometimes it is generated at a length of 135, 136 or 137 bytes. Is there a way to specify the length or some padding at the end? Any other ideas or comments are appreciated. private byte[] ecdsaSign(ECPrivateKey key, byte[] content) throws Exception { Signature ecdsaSign = Signature.getInstance(

SHA-256 hashes different between C# and Javascript

醉酒当歌 提交于 2019-11-28 10:17:28
I am currently working on a project that will involve credit card swipes for admissions based on database rows. Like a will call system, the SHA-256 hash of the CC number must match the hash in the DB row in order to be considered the "proper pickup". However, because the box office system is based in the browser, the CC number on pickup must be hashed client-side, using Javascript, and then compared to the previously downloaded will call data. However when trying to hash the numbers, the hash always ends up different than what was hashed when the DB row was created (using VB.NET and SQL

Why isn't my PHP SHA256 hash equivalent to C# SHA256Managed hash

佐手、 提交于 2019-11-28 07:06:32
问题 Why aren't these the same? php: $hash = hash('sha256', $userData['salt'] . hash('sha256', $password) ); c# public static string ComputeHash(string plainText, string salt) { // Convert plain text into a byte array. byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); byte[] saltBytes = Encoding.UTF8.GetBytes(salt); SHA256Managed hash = new SHA256Managed(); // Compute hash value of salt. byte[] plainHash = hash.ComputeHash(plainTextBytes); byte[] concat = new byte[plainHash.Length +

Sha256 in Objective-C for iPhone

不羁的心 提交于 2019-11-28 05:04:59
When I use this code to create a sha256 of a string unsigned char hashedChars[32]; NSString *inputString; inputString = [NSString stringWithFormat:@"hello"]; NSData * inputData = [inputString dataUsingEncoding:NSUTF8StringEncoding]; CC_SHA256(inputData.bytes, inputData.length, hashedChars); It returns the hash correctly, but I need to insert a string like this \x00\x25\x53 and in this case, the function returns a sha256 of empty string because the specified encoding cannot be used to convert the receiver. Now, my question is:How to insert this special characters for generate a correct hash?

Calculate and print SHA256 hash of a file using OpenSSL

做~自己de王妃 提交于 2019-11-28 03:15:19
问题 I'm trying to write a C function using OpenSSL/libcrypto to calculate the SHA256 sum of a file. I'm basing my code on Adam Lamer's c++ example here. Here's my code: int main (int argc, char** argv) { char calc_hash[65]; calc_sha256("file.txt", calc_hash); } int calc_sha256 (char* path, char output[65]) { FILE* file = fopen(path, "rb"); if(!file) return -1; char hash[SHA256_DIGEST_LENGTH]; SHA256_CTX sha256; SHA256_Init(&sha256); const int bufSize = 32768; char* buffer = malloc(bufSize); int

Is it okay to truncate a SHA256 hash to 128 bits?

前提是你 提交于 2019-11-28 02:45:39
问题 MD5 and SHA-1 hashes have weaknesses against collision attacks. SHA256 does not but it outputs 256 bits. Can I safely take the first or last 128 bits and use that as the hash? I know it will be weaker (because it has less bits) but otherwise will it work? Basically I want to use this to uniquely identify files in a file system that might one day contain a trillion files. I'm aware of the birthday problem and a 128 bit hash should yield about a 1 in a trillion chance on a trillion files that

Generating a sha256 from the Linux command line [closed]

折月煮酒 提交于 2019-11-28 02:40:43
I know the string "foobar" generates the SHA 256 hash c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 using http://hash.online-convert.com/sha256-generator However the command line shell: hendry@x201 ~$ echo foobar | sha256sum aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f - Generates a different hash. What am I missing? mvds echo will normally output a newline, which is suppressed with -n . Try this: echo -n foobar | sha256sum If you have installed openssl , you can use: echo -n "foobar" | openssl dgst -sha256 For other algorithms you can replace -sha256

How to generate checksum & convert to 64 bit in Javascript for very large files without overflowing RAM?

夙愿已清 提交于 2019-11-28 00:36:43
问题 Question : How to generate a checksum correctly, which is unique, consistent independent of browsers? Also, I would like to convert a SHA256/MD5 checksum string to 64-bit. How to properly read a file without huge RAM requirement to generate checksum? i.e. how do we deal with 1 GB file without compromising RAM e.g. Is it possible to read a file without loading it into memory? (see the answer) This project seems promising, but couldn't get it worked either. My intention is to generate the

PBKDF2 with SHA256 on android

ε祈祈猫儿з 提交于 2019-11-27 21:38:51
I want to generate a derived hash of a password using PBKDF2 with SHA256. with this SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1") this work but it use SHA1. With SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256") (or SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256","SC") when with spongycastle) i have an error. How can i succeed to generate a hash using PBKDF2WithHmacSHA256? If you use version 1.47 or higher of SpongyCastle, you can invoke PBKDF2WithHmacSHA256 directly: PKCS5S2ParametersGenerator generator = new PKCS5S2ParametersGenerator(new SHA256Digest()); generator.init