encryption

SSL For Intranet Applications Deployed at Multiple Companies

会有一股神秘感。 提交于 2021-01-29 19:26:18
问题 I have node application that serves over https. The app is served over the in tra net. I remember generating the SSL key on the Linux command line and they've expired. I have aspirations of installing this app at multiple companies. It will run on each company's int ran et yet I do want the application to be accessible remotely (by setting up some port forwarders on the corporate firewall). The SSL keys are pain. I want the communication to be encrypted, but because I'm generating the SSL

C# RSA decrypt parameter is incorrect

岁酱吖の 提交于 2021-01-29 17:21:58
问题 I am trying to decrypt communication from web sockets secured with SSL certificate. The certificate is installed on the machine and the private key is present. I have this decrypt function public static string DecryptTry(X509Certificate2 x509, string stringTodecrypt) { try { if (x509 == null || string.IsNullOrEmpty(stringTodecrypt)) throw new Exception("A x509 certificate and string for decryption must be provided"); if (!x509.HasPrivateKey) throw new Exception("x509 certificate does not

Apache POI throwing OOM error when trying to password protect modest sized XLSX workbooks (~=80MB)

穿精又带淫゛_ 提交于 2021-01-29 16:14:21
问题 using java 8 and apache POI and POI-OOXML 3.14 Here's my method: private static void encryptXlsx(String inputPath, String outputPath, String password) throws IOException, InvalidFormatException, GeneralSecurityException { //create a new workbook Workbook wb = WorkbookFactory.create(new File(inputPath)); //Add password protection and encrypt the file POIFSFileSystem fs = new POIFSFileSystem(); EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile); Encryptor enc = info.getEncryptor();

Cannot decrypt in C# an encrypted string done by openssl. Always get Org.BouncyCastle.Security.InvalidKeyException

北城余情 提交于 2021-01-29 11:07:24
问题 I trying to decrypt a string in C# that was encrypted by openssl via command line but it keep thrown the exception below: Exception thrown: 'Org.BouncyCastle.Security.InvalidKeyException' in BouncyCastle.Crypto.dll An unhandled exception of type 'Org.BouncyCastle.Security.InvalidKeyException' occurred in BouncyCastle.Crypto.dll Not an RSA key I am using RSA encryption and these are the commands (from git bash) that I use to generate the .pem file sand encrypt/decrypt a test string: // Create

Instantiate java.security classes PrivateKey and X509Certificate from .key and .cer files

与世无争的帅哥 提交于 2021-01-29 09:33:17
问题 The original goal is: Generate a https url where one of parameters is PKCS7 detached signature (RSA, SHA-256, UTF-8, BASE64). What do I have: private key (.key file begin with "-----BEGIN RSA PRIVATE KEY-----", end like this "kIng0BFt5cjuur81oQqGJgvU+dC4vQio+hVc+eAQTGmNQJV56vAHcq4v -----END RSA PRIVATE KEY-----") self signed certificate (.cer file begin with "-----BEGIN CERTIFICATE-----", end like this "xwRtGsSkfOFL4ehKn/K7mgQEc1ZVPrxTC7C/g+7grbKufvqNmsYW4w== -----END CERTIFICATE-----") data

Decrypt string with Rijndael return “System.SecureString” (as a string) but not the string

断了今生、忘了曾经 提交于 2021-01-29 08:23:49
问题 I'm using Rijndael Algorithm to encrypt strings (user passwords), but when I decrypt them, it returns me "System.SecureString", and not my decrypted password. I'm using this basic code: public static string DecryptString(string cipherText, string password) { byte[] key, iv; Rfc2898DeriveBytes rfcDb = new Rfc2898DeriveBytes(password, Encoding.UTF8.GetBytes(password)); key = rfcDb.GetBytes(16); iv = rfcDb.GetBytes(16); byte[] cipheredData = Convert.FromBase64String(cipherText); RijndaelManaged

CipherInputStream hangs

◇◆丶佛笑我妖孽 提交于 2021-01-29 08:17:48
问题 I am attempting to use encryption to communicate over sockets using java. I've successfully communicated with sockets without encryption, but when I try with encryption the program freezes. Here is the parent Connection class that works just fine: public class Connection implements Runnable { protected Socket socket; protected ObjectInputStream objectInputStream; protected ObjectOutputStream objectOutputStream; protected Thread listeningThread; protected Thread dispatchThread; protected

Decrypting MD5 hashed text when salt is known

别说谁变了你拦得住时间么 提交于 2021-01-29 07:23:04
问题 Let's say I have the following MD5 hashed password: bec0932119f0b0dd192c3bb5e5984eec If I know that the original password was salted and hashed and know that instead of typical salt it was just wrapped in 'flag{}' before MD5 summing it. How may I decrypt MD5 in this case? 回答1: The other answer is not correct in the definition of what you are trying. Let's begin with the formal definitions of Cryptographical hash functions' required resistances. The below from Cryptographic Hash-Function

What is missing from the AES Validation Standard Pseudocode for the Monte Carlo Tests?

痞子三分冷 提交于 2021-01-29 05:23:59
问题 I'm trying to use the prescribed validation procedure for AES-128 in CBC mode, as defined in the NIST AESAVS standard. One of the more important parts of the test suite is the Monte Carlo test, which provides an algorithm for generating many 10000 pseudorandom tests cases such that it is unlikely that a hardcoded circuit could fake AES. The algorithm pseudocode therein appears to be taking some liberties with variable scope and definition, so I am hoping someone could help me fill in the

CryptoJS decode with PyCrypto

懵懂的女人 提交于 2021-01-29 05:23:41
问题 Hey I have such Javascript code CryptoJS.algo.AES.keySize = 32, CryptoJS.algo.EvpKDF.cfg.iterations = 1e4, CryptoJS.algo.EvpKDF.cfg.keySize = 32; var decrypted = CryptoJS.AES.decrypt(message, passphrase); And I need to create an analog using Python (I'm trying to use pycryptodome) But I have several questions: Have can I get key and iv from passphrase? How should reflect all these (CryptoJS.algo.AES.keySize = 32, CryptoJS.algo.EvpKDF.cfg.iterations = 1e4, CryptoJS.algo.EvpKDF.cfg.keySize = 32