cryptography

How to create symmetric encryption key with Google Tink?

会有一股神秘感。 提交于 2020-01-13 04:28:12
问题 I have a key (say) "thisist0psecret" that I want to use as a symmetric encryption/decryption key with the Google Tink library. I am baffled that I am unable to do this simple thing. I can generate new keys (using various templates AES128_GCM, etc.), serialize them and then read them back with KeysetReader. But, for the life of me, I cannot figure out how to create a symmetric key with the specific key bytes that I specify . I am able to do the following, for example, with Tink: KeysetHandle

Lockbox digital signature component problem

徘徊边缘 提交于 2020-01-13 03:20:10
问题 I'm evaluating TurboPower LockBox library for digital signing. I've created a 1024 bit RSA key and tried to sign a 260 bytes of text with it. After changing one or two characters in the text the signature is still valid for it. Is that ok? Or maybe it's a problem with this library. Changing even one character has a crucial effect. Do I need to create a larger key? UPDATE To test the library I used the demo application that comes with it. I have generated a 1024 RSA key pair and then tried the

Order-independent ciphers

旧巷老猫 提交于 2020-01-12 17:39:11
问题 Is there exist a ciphering approach such that encrypting and decrypting order is arbitrary? Like using two padlocks on the same lock loop. That is, if there are two keys (or keypairs) K1, K2 , message M , and the cryptogram C is obtained as (for example) C=M*K1*K2 (where * denotes ciphering), then the message M can be retrieved in each of the following ways: 1) M=C*K1*K2 , 2) M=C*K2*K1 (here * denotes deciphering). Obviously, XOR is a trivial candidate. Do any cryptographically strong

How does using a salt make a password more secure if it is stored in the database?

假装没事ソ 提交于 2020-01-12 13:58:29
问题 I am learning Rails, at the moment, but the answer doesn't have to be Rails specific. So, as I understand it, a secure password system works like this: User creates password System encrypts password with an encryption algorithm (say SHA2). Store hash of encrypted password in database. Upon login attempt: User tries to login System creates hash of attempt with same encryption algorithm System compares hash of attempt with hash of password in the database. If match, they get let in. If not,

Encrypting string in javascript and decryption in java

大城市里の小女人 提交于 2020-01-12 10:07:35
问题 I would like to know if someone know any library to do encryption in javascript and decryption in java. I have already tried many API, But getting not not getting same values in java. I want public-private key encryption and hence try to use RSA. Few i have used are: http://www-cs-students.stanford.edu/~tjw/jsbn/ http://ats.oka.nu/titaniumcore/js/crypto/readme.txt http://www.ohdave.com/rsa/ Few thing i checked, javascript breaks string into small chunks and then encrypt them which make cipher

Encrypting string in javascript and decryption in java

倖福魔咒の 提交于 2020-01-12 10:06:26
问题 I would like to know if someone know any library to do encryption in javascript and decryption in java. I have already tried many API, But getting not not getting same values in java. I want public-private key encryption and hence try to use RSA. Few i have used are: http://www-cs-students.stanford.edu/~tjw/jsbn/ http://ats.oka.nu/titaniumcore/js/crypto/readme.txt http://www.ohdave.com/rsa/ Few thing i checked, javascript breaks string into small chunks and then encrypt them which make cipher

Encrypting string in javascript and decryption in java

大城市里の小女人 提交于 2020-01-12 10:06:11
问题 I would like to know if someone know any library to do encryption in javascript and decryption in java. I have already tried many API, But getting not not getting same values in java. I want public-private key encryption and hence try to use RSA. Few i have used are: http://www-cs-students.stanford.edu/~tjw/jsbn/ http://ats.oka.nu/titaniumcore/js/crypto/readme.txt http://www.ohdave.com/rsa/ Few thing i checked, javascript breaks string into small chunks and then encrypt them which make cipher

Encrypt in Javascript with SJCL and decrypt in PHP

孤街浪徒 提交于 2020-01-12 09:18:06
问题 I want to encrypt some data in Javascript and after sending it the php server it could be decrypted. I'm planig to use JS encryption library as SJCL : http://crypto.stanford.edu/sjcl/ . Up to now I can encrypt my data in JS and send it via ajax post. my JS code lool like this. sjcl.encrypt('a_key','secured_message'); My question is how do I decrypt my data in php. If it is possible show me how to do it with an example code. (note: SSL is not a option for me, and now I'm planning to use the

Cryptographically Secure Random String Function

半腔热情 提交于 2020-01-12 09:14:28
问题 Goal: Find the most cryptographically secure random string generator. Using Alphabetic, numeric and if possible special characters in the string. I have been reading on here and other places, but I still hear so many different answers/opinions. Can people who are up to date and knowledgeable about security and cryptography chime in here. The following functions will be used to generate a 8 character random password and also generate a 128 character random token. Function 1: /** * Used for

Only RSAPrivate (Crt) KeySpec and PKCS8EncodedKeySpec supported for RSA private keys

橙三吉。 提交于 2020-01-12 08:38:53
问题 I following the steps from the link : How to read .pem file to get private and public key. I executed the following three commands: 1. $openssl genrsa -out mykey.pem 2048 2. $openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem -out private_key.pem -nocrypt 3. $ openssl rsa -in mykey.pem -pubout -outform DER -out public_key.der This created three files, but when I was trying to read those through Java code I started facing below error: PUBLIC KEY EXPO : 65537 Only RSAPrivate(Crt