7,349 questions
Best practices
0
votes
10
replies
92
views
Is there what the convenient way to store message and iv(in base64) together in a single variable or text file or in database cell using AES 256?
In AES any message itself has is a two walues. Ghgf6hGh== and ghyTgas9= for example. How to combine them together and send to another person. I thougth about json, but, json has symbols that is not to ...
Tooling
0
votes
12
replies
87
views
fDgtyhNvgfh5hJ7k== , some bytes lost? When encrypt with AES CBC using C++ .NET SDK in Visual Studio
I did encryption with AES, got cipherText, key and iv. And I have wrote this into .txt files.
All stuff in txt files look like this: dkfhepfGqW4fgheHjkjkdd69NkashgjtnBnh5f== , or like this: ...
0
votes
1
answer
178
views
Why do I need an IvParameter and how do I implement it?
I'm trying to write a java program that encrypts and decrypts a byte array of text based on a password, but when decrypting, it returns an error
Error message:
Exception in thread "main" ...
0
votes
0
answers
140
views
Why am I getting "Invalid initialization vector" when calling my signed URL upload API in Node.js?
I’m working on a Node.js backend that generates a signed URL for uploading files to AWS S3 via CloudFront.
However, when I hit the signed URL endpoint from curl, I always get the following response:
{&...
5
votes
1
answer
206
views
Encrypting and decrypting with AES returns System.Byte[] [duplicate]
Using AES in C# I wrote two static methods for encryption and decryption.
Encrypt:
static byte[] Encrypt(byte[] plaintext, byte[] Key, byte[] IV)
{
byte[] encrypted_data = null;
using (Aes ...
0
votes
1
answer
201
views
Decrypting data from stream without knowing data size
Assuming we know the key and the IV for the data we're getting from the stream, is it possible to decrypt it within stream? I encrypted the same message three times and then decrypted it all at once, ...
1
vote
2
answers
121
views
pycryptodome decryption (aes-128 cbc) is yielding incorrect result
I have simple code to encrypt and decrypt as follows...
(1) To encrypt:
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
from Crypto.Hash import SHA256 as sha256
def sha(text):...
2
votes
0
answers
113
views
PSA_ERROR_INSUFFICIENT_ENTROPY when trying to encrypt plaintext
I am developing an application which uses Zephyr. I am trying to encrypt plaintext into ciphertext using AES-CCM encryption with my function as below. No matter what, psa_crypto_init() fails with ...
3
votes
1
answer
100
views
Does C# .NET AES GenerateKey (RandomNumberGenerator) truly use /dev/urandom on Linux
Generating a key and I have tried to understand how GenerateKey gets random in Linux.
Example:
using System;
using System.Security.Cryptography;
namespace AesEncryption
{
class Program
{
...
2
votes
1
answer
133
views
Difference in behavior between AesManaged and Aes.Create()
I'm porting an app from .NET framework to .NET and have notice some difference in behavior after the conversion.
Inside a library that I use (not written by me) this piece of code will behave ...
0
votes
0
answers
131
views
AES + RSA OTA updater
I am doing an OTA updater for an ESP32. I am using AWS Lambda to encrypt a presigned URL that is being generated for a certain element from an S3 bucket. I am first doing an AES encryption, and then ...
0
votes
1
answer
83
views
Is it possible create an ObjectMapper configured such that it AES encrypts all fields except fields annotated with a certain annotation?
Let's say you have an annotation configured on a per field basis:
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import ...
0
votes
1
answer
176
views
How do I do softap provisioning for an esp32-c6 in flutter?
I'm trying to write an app in flutter to perform softap provisioning for an ESP32-C6 (https://docs.espressif.com/projects/esp-idf/en/v5.4.1/esp32c6/api-reference/provisioning/wifi_provisioning.html). ...
2
votes
1
answer
94
views
StreamReader returning empty string when decrypting using Aes
public static byte[] TestEncrypt(string plainText, byte[] key, byte[] iv)
{
using Aes aes = Aes.Create();
aes.Key = key;
aes.IV = iv;
// Create a new MemoryStream object to ...
0
votes
1
answer
102
views
ggplot trouble when I combine a layer with group and a layer with group=1
I want to combine with ggplot2 a layer where I compare
three regressions and a layer where I just display three
new samples to evaluate their locations to the regressions lines.
(the mock data is ...