encryption

How to encrypt user data in Firebase

你离开我真会死。 提交于 2020-07-31 06:21:10
问题 I am using the email/password sign in method for Firebase. I would like to encrypt the data users save into the realtime database before sending it to the database. Firebase already handle the user password, but can I somehow use it to encrypt data which can't be decrypted by me only the client? It would be nice if I could achieve it with the client sdk. So my flow would be something like this: User sign in with it's credentials (which is handled by firebase itself) User encrypt some data

Rijndael 256 encryption with Java & Bouncy Castle

怎甘沉沦 提交于 2020-07-22 13:26:07
问题 I'm working on a project built in pure php, i'm doing a rework on the login, but the users in the database are cipher in Rijndael-256, i've tried a lot of things and nothing seems to work, and i feel i'm so close with this code, but it doesn't work, and i'm really lost private final String key = "..."; public String decrypt(String password, String cypherKey) { try { password = password.substring(0, password.lenght() - 1); // 1 byte[] passwordBytes = password.getBytes("UTF-8"); byte[] key =

Rijndael 256 encryption with Java & Bouncy Castle

…衆ロ難τιáo~ 提交于 2020-07-22 13:26:04
问题 I'm working on a project built in pure php, i'm doing a rework on the login, but the users in the database are cipher in Rijndael-256, i've tried a lot of things and nothing seems to work, and i feel i'm so close with this code, but it doesn't work, and i'm really lost private final String key = "..."; public String decrypt(String password, String cypherKey) { try { password = password.substring(0, password.lenght() - 1); // 1 byte[] passwordBytes = password.getBytes("UTF-8"); byte[] key =

Secure unsubscribe link - How much encryption is enough?

◇◆丶佛笑我妖孽 提交于 2020-07-22 13:20:50
问题 My users can subscribe to threads that send them an email with a simple unsubscribe link. This link contains an encrypted subscribeid and a verifying userid via this process: // generate iv and create encrypted data $iv = openssl_random_pseudo_bytes(16); $encrypted = openssl_encrypt($data, 'AES-128-CBC', ENCRYPTION_KEY,0,$iv); // send the iv along with the encrypted text $ciphertext = $iv . $encrypted; // generate a hash which can verify the data has not changed $hash = hash_hmac('sha1',

Encrypt/Decrypt String Kotlin

久未见 提交于 2020-07-21 04:03:27
问题 I've created this two extensions in Kotlin to Encrypt/Decrypt strings: fun String.encrypt(seed : String): String { val keyGenerator = KeyGenerator.getInstance("AES") val secureRandom = SecureRandom.getInstance("SHA1PRNG") secureRandom.setSeed(seed.toByteArray()) keyGenerator.init(128, secureRandom) val skey = keyGenerator.generateKey() val rawKey : ByteArray = skey.encoded val skeySpec = SecretKeySpec(rawKey, "AES") val cipher = Cipher.getInstance("AES/CBC/PKCS5Padding") cipher.init(Cipher

Caesar cipher encrypting a single character in MIPS

心不动则不痛 提交于 2020-07-16 10:22:00
问题 I'm having some problems in creating a program to encrypt a message. At this point i'm just trying to input a char and the output should be the char+5 positions in the alphabet. So the program should read the char in ASCII and add 5 to it and then print the letter. Ex.: Input: A Output: F It should only work for Capital letters, so every char should be >=65 and <=90. So, if I write 'Z' it should start the alphabet from the beginning and print 'E'. So far, my code looks like this: li $v0, 8

Caesar cipher encrypting a single character in MIPS

不想你离开。 提交于 2020-07-16 10:20:44
问题 I'm having some problems in creating a program to encrypt a message. At this point i'm just trying to input a char and the output should be the char+5 positions in the alphabet. So the program should read the char in ASCII and add 5 to it and then print the letter. Ex.: Input: A Output: F It should only work for Capital letters, so every char should be >=65 and <=90. So, if I write 'Z' it should start the alphabet from the beginning and print 'E'. So far, my code looks like this: li $v0, 8

Does HTTPS use Asymmetric or Symmetric encryption?

淺唱寂寞╮ 提交于 2020-07-10 08:10:08
问题 I have searched all this morning but I've found websites where it is said that data is sent through an asymmetric encryption using the TLS protocol. Then I found the contrary. Please can you tell me which is true? Thanks. And does anyone know a guide where it is explained step by step the handshake of TLS protocol over http? 回答1: HTTP uses no encryption at all, as defined in https://tools.ietf.org/html/rfc2616 HTTPS on other hand, uses TLS which may choose from bunch of algorithms to achieve

How to fix error “java.security.NoSuchAlgorithmException: RSA/ECB/PKCS1Padding”

放肆的年华 提交于 2020-07-10 06:58:27
问题 I have some public/private encryption code written. It works fine when the data to be encrypted is short, example: "this is plain text". private static final String ALGORITHM = "RSA"; public static byte[] encryptWithPrivateKey(byte[] privateKey, byte[] inputData) throws Exception { PrivateKey key = KeyFactory.getInstance(ALGORITHM).generatePrivate(new PKCS8EncodedKeySpec(privateKey)); Cipher cipher = Cipher.getInstance(ALGORITHM); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] encryptedBytes =

RSA encryption using Microsoft Excel

こ雲淡風輕ζ 提交于 2020-07-09 07:13:48
问题 Is there any ready to use implementation of RSA encryption algorithm for Excel( just encrypt a plain text using given public key, nothing else ) ? Or I need to implement it from the beginning ? I Google but found nothing useful. Any useful links is welcome. UPDATE: I need a non-commercial library. 回答1: This site Simple RSA Encryption and this site have some example code for both VBA and .NET 来源: https://stackoverflow.com/questions/13500280/rsa-encryption-using-microsoft-excel