encryption

Decrease memory consumption when encrypting files c#

蹲街弑〆低调 提交于 2020-01-16 04:29:07
问题 My encryption app is using to much memory and it simply can't handle large files, how can I optimize my code for handling large files? I am using the code below to convert the file to base64 (increasing the file size dramatically) Console.Write("Enter File Path: "); docPath = Console.ReadLine(); extension = docPath.Substring(docPath.IndexOf(".")).Trim(); byte[] binarydata = File.ReadAllBytes(docPath); text = System.Convert.ToBase64String(binarydata, 0, binarydata.Length); var Encrypted =

Alternative to hashed SSN as a key in MySQL

点点圈 提交于 2020-01-16 04:25:12
问题 I have a problem similar to the following: A person begins working as a consultant for "Company A". Their HR person sets up an account for them. A record is created for the person in a "person" table and a "person-company" one. The person is also working for "Company B" (which Company A may or may not know about). When Company B enters their info they should NOT create a record in "person" but SHOULD create one in "person-company". The person is required to do training for the state, so if

Javascript AES encryption doesn't match iOS AES encryption

烈酒焚心 提交于 2020-01-16 04:24:32
问题 I am encrypting an NSString in iOS like this which encodes and decodes fine: NSString *stringtoEncrypt = @"This string is to be encrypted"; NSString *key = @"12345678901234567890123456789012"; // Encode NSData *plain = [stringtoEncrypt dataUsingEncoding:NSUTF8StringEncoding]; NSData *cipher = [plain AES256EncryptWithKey:key]; NSString *cipherBase64 = [cipher base64EncodedString]; NSLog(@"ciphered base64: %@", cipherBase64); // Decode NSData *decipheredData = [cipherBase64 base64DecodedData];

AES and its cipher modes

不问归期 提交于 2020-01-16 03:41:29
问题 I was trying encryption/decryption with AES then I tried the CBC & ECB modes I got the same encrypted output from all three ! is this how it goes? it's may not be wrong but I just don't know what to expect . and what's the point of having modes if they all produce the same cipher ? is it time or performance complexity ? can you explain the difference between AES and its cipher modes ? what's the default cipher mode ? or if you can give me any references cuz MSDN is not clear enough thank you

Does node.js crypto use fixed tag size with GCM mode?

半城伤御伤魂 提交于 2020-01-16 02:01:09
问题 I am implementing a scheme with cipher in GCM mode in node.js. I have to append/prepend GCM tag to the ciphertext in order to check the integrity. However, I am not sure how big the tag will be! On crypto++ wiki, I read that the size could vary and that it's actually a parameter of the GCM mode. Citing from the wiki, emphasis mine: The parameters which must be supplied and used by both parties are: key and key size iv and iv size tag size However, in node documentation, there is nothing about

Getting javax.net.ssl.SSLHandshakeException in JDK11

我是研究僧i 提交于 2020-01-16 01:24:10
问题 I am setting up my web application in JDK11 runtime environment. I am able to bring my application server up in JDK8 runtime enviroment but getting below exception after switching to JDK11 enviroment. Exception : javax.net.ssl.SSLHandshakeException: Invalid ECDH ServerKeyExchange signature For SSlHandshake I am using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 cipher suite Algorithm. I am suspecting that this algorithm is not supported by JDK11(https://bugs.openjdk.java.net/browse/JDK-8209965). I

Converting Mike Shaffer's RC4Encryption to C#

房东的猫 提交于 2020-01-16 01:11:07
问题 I'm following an article, http://www.4guysfromrolla.com/articles/091802-1.3.aspx, which shows how to convert Mike Shaffer's VB RC4 encryption to C#, however I'm getting different results than the original article, http://www.4guysfromrolla.com/webtech/010100-1.shtml. Using this test link from the original article, http://www.4guysfromrolla.com/demos/rc4test.htm, with a password of "abc" and plain text of "testing123", I get "B9 F8 AA 5D 31 B1 8A 42 1E D4". However, when using the C# version,

CMS encryption/decryption from openssl broken

老子叫甜甜 提交于 2020-01-15 23:45:16
问题 So i navigated to the demos folder of openssl in /usr/share/doc/libssl-doc/demos/cms I compiled the test files there gcc cms_enc.c -o enc -lssl -lcrypto gcc cms_dec.c -o dec -lssl -lcrypto Then i started both of them first ./enc then ./dec. Unfortunately the following error occured 140502142240416:error:0200B009:system library:fread:Bad file descriptor:bss_file.c:245: 140502142240416:error:20082002:BIO routines:FILE_READ:system lib:bss_file.c:246: 140502142240416:error:0606506D:digital

CMS encryption/decryption from openssl broken

旧街凉风 提交于 2020-01-15 23:44:09
问题 So i navigated to the demos folder of openssl in /usr/share/doc/libssl-doc/demos/cms I compiled the test files there gcc cms_enc.c -o enc -lssl -lcrypto gcc cms_dec.c -o dec -lssl -lcrypto Then i started both of them first ./enc then ./dec. Unfortunately the following error occured 140502142240416:error:0200B009:system library:fread:Bad file descriptor:bss_file.c:245: 140502142240416:error:20082002:BIO routines:FILE_READ:system lib:bss_file.c:246: 140502142240416:error:0606506D:digital

What is the difference between FileSink, StringSink, Filesource, StringSource Crypto++

北战南征 提交于 2020-01-15 20:15:06
问题 I am reading in an image, encrypting it, then decrypting it. The goal is to be looping this eventually and recording the time it takes for the process to complete. Currently what I have it reads the file in, then it encrypts it, encrypts it, the creates another file based on the recovered data. I don't need to make another file with the decrypted picture. Previously I had been using StringSource and StringSink , but that only worked for text files. I received some help at How to read an image