cryptography

Points calculated using this elliptic curve point multiplication do not lie on the curve and this class brings Arithmetic exception

余生颓废 提交于 2019-12-21 03:18:07
问题 I get stack on my error of point multiplication using standard projective coordinates. I don't know what i missed but the multiplied points do not lie on the curve and some times it outputs something like Arithmetic Exception: integer is not invertible. public class ECPointArthimetic { EllipticCurve ec; private BigInteger x; private BigInteger y; private BigInteger z; private BigInteger zinv; private BigInteger one = BigInteger.ONE; private BigInteger zero = BigInteger.ZERO; private boolean

Java Encryption and Javascript Decryption [closed]

南笙酒味 提交于 2019-12-21 03:03:13
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I am trying to encrypt a data in java and decrypt the same in javascript. There is already a similar question in SO but it does not work for me. My question is - Encrypted Text given by Java code is not getting decrypted by Javascript. I have hardcoded the the encrypted text and key in my JS below.

Android - Removing padded bits in decryption

…衆ロ難τιáo~ 提交于 2019-12-21 03:01:30
问题 I'm working on a security application using my own customized cryptography method, and having a problem on message decryption. According to the theory, the input has to be padded to meet the required bit to execute the encryption. But the padded bits stays even after the decryption. Here's an example: input (before padding) : q input (after padding) : 113 0 0 0 0 0 0 0 (in Bytes) Then I execute some code: bytes[] a = encrypt(input); bytes[] b = decrypt(a); String output = ""; output = new

Android - Removing padded bits in decryption

天大地大妈咪最大 提交于 2019-12-21 03:01:19
问题 I'm working on a security application using my own customized cryptography method, and having a problem on message decryption. According to the theory, the input has to be padded to meet the required bit to execute the encryption. But the padded bits stays even after the decryption. Here's an example: input (before padding) : q input (after padding) : 113 0 0 0 0 0 0 0 (in Bytes) Then I execute some code: bytes[] a = encrypt(input); bytes[] b = decrypt(a); String output = ""; output = new

Android KeyStore Initialization

时光毁灭记忆、已成空白 提交于 2019-12-21 02:59:21
问题 First off I am new to android Programming, though I am not new to programming itself. What I am, essentially, trying to do is to save my encryption Keys into the Android Keystore. There seems to be a phenomenal lack of such information on GOOGLE, itself. Since there is not much how-to available on the topic I am assuming that it isn't fairly standard knowledge. So can someone please give me a sample code to Initialize the KeyStore(Will be using AES-256). Save multiple keys in a KeyStore

C# SHA-256 vs. Java SHA-256. Different results?

落花浮王杯 提交于 2019-12-21 02:49:28
问题 I want to convert a some code which is in Java to C#. Java Code: private static final byte[] SALT = "NJui8*&N823bVvy03^4N".getBytes(); public static final String getSHA256Hash(String secret) { try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); digest.update(secret.getBytes()); byte[] hash = digest.digest(SALT); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < hash.length; i++) { hexString.append(Integer.toHexString(0xFF & hash[i])); } return hexString.toString(

java.security.InvalidKeyException: Key length not 128/192/256 bits

做~自己de王妃 提交于 2019-12-21 02:46:17
问题 I am new to Java and was trying to use Hybrid cryptography using AES-128 Symmetric encryption and then RSA-1024 Asymmetric encryption on the generated symmetric key. Can someone help why I am getting this exception. I have already followed the other posts, and downloaded the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files version 6 in the appropriate folder. Code snippet: import java.io.BufferedReader; import java.io.InputStreamReader; import java.security.Key;

Cipher.init() required for each message?

浪尽此生 提交于 2019-12-20 20:29:13
问题 Assume two clients are exchanging secure messages back and forth. Must this block be run every time for each message, or can any step(s) be done just once at start: cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, keySpec); output = cipher.doFinal(content); I guess to lend some context- although I don't (yet) understand the internals completely, it is my understanding that for security purposes it's important to change the IV for each message. So I think

Which built-in .NET cryptography algorithm is the most secure?

♀尐吖头ヾ 提交于 2019-12-20 18:25:36
问题 Which cryptography algorithm is the most secure that ships with .net? 回答1: You cannot directly compare all types of cryptographic algorithms. That would be like comparing a sorting algorithm with a multiplication algorithm: they have different purposes. That being said, I would answer: Symmetric cipher: AES-256 Asymmetric cipher: RSA with 4096 bit key (I believe that is the maximum in .NET) or ECDSA with 571 bit key (but that is only supported in .NET 3.5) Hash: SHA-512 Message Authentication

.NET implementation (libraries) of elliptic curve cryptography

半腔热情 提交于 2019-12-20 17:37:33
问题 Please can you suggest any implementation of elliptical curve cryptography to be used on .NET platform? Also if you have used them, can you tell me the recommended curves that should be used? [EDIT] As @FatCat mentioned, its implementation is available in .NET framework 3.5 but that is only available on windows vista. Can you please suggest another way/library to use it? 回答1: Check out the Bouncy Castle library for C#, it has ECDH and ECDSA. 回答2: The .NET Framework already includes Diffie