aes

Encrypt/Decrypt between Postgres and Node

安稳与你 提交于 2020-08-25 21:19:25
问题 Problem : We have to encrypt a certain column on a certain table (Postgres). It has to be decryptable in SQL queries and in our nodejs/sequelize application layer. The encryption can happen in either layer, but it must be decodable from either. The issue I'm running into (and I'm sure it's user error) is that if I encrypt in the db I can only decrypt in the db, and the same for node. I've tried using PGP_SYM_ENCRYPT and ENCRYPT in postgres and crypto and crypto-js/aes in node. I've gotten it

Encrypt/Decrypt between Postgres and Node

 ̄綄美尐妖づ 提交于 2020-08-25 21:19:14
问题 Problem : We have to encrypt a certain column on a certain table (Postgres). It has to be decryptable in SQL queries and in our nodejs/sequelize application layer. The encryption can happen in either layer, but it must be decodable from either. The issue I'm running into (and I'm sure it's user error) is that if I encrypt in the db I can only decrypt in the db, and the same for node. I've tried using PGP_SYM_ENCRYPT and ENCRYPT in postgres and crypto and crypto-js/aes in node. I've gotten it

Encrypt/Decrypt between Postgres and Node

ぃ、小莉子 提交于 2020-08-25 21:19:07
问题 Problem : We have to encrypt a certain column on a certain table (Postgres). It has to be decryptable in SQL queries and in our nodejs/sequelize application layer. The encryption can happen in either layer, but it must be decodable from either. The issue I'm running into (and I'm sure it's user error) is that if I encrypt in the db I can only decrypt in the db, and the same for node. I've tried using PGP_SYM_ENCRYPT and ENCRYPT in postgres and crypto and crypto-js/aes in node. I've gotten it

Encryption decryption AES for all type of file in java

℡╲_俬逩灬. 提交于 2020-08-10 18:52:52
问题 how to modify this AES encryption code so that it can encrypt and decrypt any type of file (pdf, docx....), because when I decrypt a pdf file or other I don't get the original file. public EncryptData(File originalFile, File encrypted, SecretKeySpec secretKey, String cipherAlgorithm) throws IOException, GeneralSecurityException{ this.cipher = Cipher.getInstance(cipherAlgorithm); encryptFile(getFileInBytes(originalFile), encrypted, secretKey); } public void encryptFile(byte[] input, File

Encryption decryption AES for all type of file in java

青春壹個敷衍的年華 提交于 2020-08-10 18:51:16
问题 how to modify this AES encryption code so that it can encrypt and decrypt any type of file (pdf, docx....), because when I decrypt a pdf file or other I don't get the original file. public EncryptData(File originalFile, File encrypted, SecretKeySpec secretKey, String cipherAlgorithm) throws IOException, GeneralSecurityException{ this.cipher = Cipher.getInstance(cipherAlgorithm); encryptFile(getFileInBytes(originalFile), encrypted, secretKey); } public void encryptFile(byte[] input, File

AES encryption in Flutter not working properly

早过忘川 提交于 2020-08-08 05:13:31
问题 This bounty has ended . Answers to this question are eligible for a +100 reputation bounty. Bounty grace period ends in 13 hours . vijay053 wants to draw more attention to this question. We are porting an app from native Android/iOS to Flutter. We are using AES symmetric encryption in native apps and they are working fine with our device. Following is the flutter code where we have tried to replicate java implementation. Here we send client(app) public key and client nonce (random 16 bit) to

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

Delegate for Android-VideoView

心已入冬 提交于 2020-06-29 04:18:47
问题 I used the VideoView class in Android(Kotlin). Here I tried to find a way to assign a direct decrypt key to the video player . I used AES-128 Encryption. Shif language(AVPlayer) provides a delegate method to an AV player. I tried to same way in android. But doesn't Help. IS there any way to assign encryption keys to VideoView in Android. Thank you. my m3u8 content #EXTM3U #EXT-X-TARGETDURATION:8 #EXT-X-MEDIA-SEQUENCE:16 #EXT-X-VERSION:3 #EXT-X-KEY:METHOD=AES-128,URI="123.key" #EXTINF:8,

How can I encypt a parameter with Rijndael in C#?

旧街凉风 提交于 2020-06-29 03:37:06
问题 How can I encrypt a parameter variable using the encryption method Rijndael ? I would like to encrypt some parameters in order to post them in an API call. The key should be in a specific form , 1st Key + IV Key . In addition , the 1st key should have a specific format. If anyone is able to provide a code sample for this, it would be awesome. 来源: https://stackoverflow.com/questions/62569677/how-can-i-encypt-a-parameter-with-rijndael-in-c

TypeError: decrypt() cannot be called after encrypt()

风格不统一 提交于 2020-06-27 21:37:39
问题 I am writing a simple code of AES encryption. I got stuck at a part where it says decrypt() cannot be called after encrypt(). I scrapped through the internet to find the solution, but unable to do so, maybe because of the lack of proper documentation examples. I tried changing the sequence these lines, but it did not help encrypted = encrypt(message) decrypted = decrypt(encrypted) I have 2 examples Example1 from Crypto.Cipher import AES key = 'ACD310AE179CE245624BB238867CE189' message = 'this