Questions tagged [aes]

Advanced Encryption Standard (AES) is a cryptographic block cipher algorithm.

Filter by
Sorted by
Tagged with
0
votes
0answers
42 views

Using System.Security.Cryptography.Aes to generate encryption key

Is the below method a safe way of generating a random encryption key to be used with AES (SymmetricAlgorithm) in .NET? It essentially piggybacks off of the Aes alg to create a random key, trimmed to ...
1
vote
1answer
89 views

employing AES algorithm in Java

I have employed an AES algorithm in order to encrypt files within a GUI. I was wondering if my algorithm is secure. Could I change anything to improve it? Is my IV secure and is it producing different ...
12
votes
3answers
2k views

Python password manager

I am writing a python password manager, and I know there's a lot of scrutiny that goes into storing passwords (don't worry, mine aren't plaintext). I was hoping that this community could help me ...
2
votes
1answer
40 views

Encrypts using AES GCM for data with limited visibility and long rest

This is the third iteration of my venture on creating an encryption/decryption solution. I asked a question here, which led to this question here, which led to this answer here, which led me to ...
1
vote
1answer
47 views

Encrypts using AES with random initialization vector meant for data with limited visibility and then long rest

I've done some research, reviewed countless SO questions that appeared similar, leading me to endless rabbit holes. My solution is working, but I don't like it. I want to create a random IV for AES ...
3
votes
1answer
175 views

AES GCM Python implementation

I've recently started looking into encryption in python and I came across with pycryptodome library. I made this simple program that encrypt/decrypt a file using AES-GCM. Could someone take a look if ...
2
votes
1answer
60 views

AES CTR mode encryption with HMAC

I am trying to implement AES CTR encryption mode with HMAC authentication for messages. It's encrypting and decrypting fine as long as the key length is 64 bytes, since AES key and HMAC key are ...
1
vote
1answer
51 views

Rijndael S-box for a string of bits

My question is more of a "can someone give me tips" rather than "can you do it for me" I have been writing a C code implementation that takes a 32-char String in the form of binary (supposed to act ...
1
vote
1answer
65 views

Encrypt data to be send from service to service

I'm working with another company in a new application for my company. My job right now is to send on demand to the other company the data that they need, ciphering some of it. I should point out that ...
2
votes
2answers
199 views

Basic AES/CBC implementation in Java

A little bit about myself: I am 18 years old, a student living in Germany and currently working on an android app. I would like if someone has the time to review my code. I am especially interested ...
0
votes
1answer
25 views

Shell POSIX OpenSSL file decryption script follow-up #3 (final)

From original very simplistic code: Shell POSIX OpenSSL file decryption script I learned a lot both from the first follow-up review, and the second one as well, many thanks! I just need one final ...
0
votes
1answer
43 views

Shell POSIX OpenSSL file decryption script follow-up #2

This question is the second follow-up of: Shell POSIX OpenSSL file decryption script The first follow-up was: Shell POSIX OpenSSL file decryption script follow-up #1 Both of which have proven very ...
1
vote
2answers
167 views

Long-term archiving + encrypting shell script

Yesterday, I very quickly, in an hour, wrote the very first version of my long-term archiving + encrypting shell script. I am aware it may have too many flaws, but none of them really prevent it from ...
3
votes
1answer
2k views

Java AES file encryption/decryption

I've written a simple Java class to encrypt and decrypt files using AES. The code works and I'm able to encrypt and decrypt files. However, I understand this is an easy way of implementing AES and ...
3
votes
2answers
119 views

JSafebox - Encrypted vault - 2nd drill

I am developing JSafebox, a portable safebox project written in Java. A first review have been completed here. The goal is to provide a secured environment where the user can browse encrypted files ...
8
votes
2answers
168 views

Encrypted safebox

I am developing JSafebox, a portable safebox project written in Java. The goal is to provide a secured environment where the user can browse encrypted files without leaking data on the drive. The ...
7
votes
3answers
3k views

File encryption with password

I would like to have my C# cryptography code reviewed. I programmed an application that encrypts files with a password (provided by the user). It basically functions as a password manager, on the ...
3
votes
2answers
2k views

AES File Encryption / Decription VB.NET

I've been looking for a while for the right code to encrypt/decrypt files with AES in vb.net. I created the code below. Is this the right way doing AES encryption/decryption nowadays? ...
7
votes
1answer
998 views

Encryption and decryption on streams using AES CBC + HMAC SHA

The goal of the code below is to: Support authenticated encryption using AES in the CBC mode and using HMAC SHA. Support encryption and decryption of data of size larger than memory (potentially). ...
4
votes
1answer
303 views

Plain Java Encryption with Integrity and Authenticity

I spent quite some time and wrote a single class for the purpose of encrypting/decrypting plaintext bytes with a passphrase. The goal is to not have any further dependencies apart from ...
2
votes
1answer
5k views

AES Encryption/Decryption with key

Is this the best way to encrypt/decrypt data? And Is it good to store Generated InitVector and CipherText in database as Base64 String which is converted from byte[]? ...
6
votes
3answers
2k views

Java AES CBC encryption/decryption

I've looked at multiple examples of Java AES CBC mode encryption but I couldn't find a proper solution that's safe to use. I ended up writing my own utility class. My questions is: Is this code safe ...
1
vote
1answer
88 views

Shell POSIX OpenSSL file decryption script follow-up #1

This question is the first follow-up of: Shell POSIX OpenSSL file decryption script Please read it before you continue reading this. Thank you. I only have one new problem solved and I would like ...
5
votes
1answer
491 views

Shell POSIX OpenSSL file decryption script

Tonight, I tried to write a Bash OpenSSL file decryption script. Encryption script will follow in highly similar manner, so I think it's not necessary now. Let's suppose we have an encrypted large ...
3
votes
0answers
365 views

PyCrypto AES-CFB with SCrypt and HMAC

I am brushing up on my Python, and since I would like to learn a bit about encryption, I figured I would give PyCrypto a try. I obviously wouldn't implement encryption in any production environment, ...
3
votes
0answers
2k views

File encryption/decryption in Python

How secure is this Python code? Can there be any attacks on this encryption? I tried to follow all the rules that I could find: KDF instead of hash, EAX (authenticated encryption mode) and other. <...
1
vote
0answers
432 views

KDF computation using CMAC with AES (as PRF) using Bouncy Castle C# library

Using bouncy castle .net implementation (version: 1.8.1.0), I am trying to create an encryption key from a known master key using a key derivation function. The NIST Publication 800-108 contains ...
2
votes
2answers
845 views

Twofish implementation in C++

I have implemented the Twofish algorithm in C++ with an OOP approach, separation of concerns and RAII idiom for the session keys and S-boxes. I have also followed Bruce Schneier's advice and my ...
34
votes
6answers
12k views

AES Implementation in C++

I've implemented AES (128, 192 and 256) in C++ and I'm looking to improve the code to make it not "DIY-crypto-bad", if at all possible. I've also been trying to optimize my code, and so far I've ...
5
votes
1answer
322 views

Simplified encryption API wrapper for RSA and AES

I'm working on an encryption library to simplify how my team uses encryption for api credentials and receiving encrypted messages from other teams/projects. This code is wrapping java.security and ...
5
votes
0answers
3k views

Java AES-256 GCM file encryption

I wrote my first file encryption program, that encrypts a file with AES-256 GCM and stores IV and salt prepended to the file content, so it's likely that I did something worse than possible. I ...
2
votes
0answers
1k views

ISO mode encryption/decryption with BouncyCastle

I need to implement an ISO-mode encryption/decryption library in C# using BouncyCastle. In this mode, users only need to exchange their RSA public keys to securely communicate. Operation is as follows:...
2
votes
2answers
2k views

C# AES256 CBC Implementation

I was looking for a proper implementation of the AES256 encryption in C# but didn't find anything I was entirely satisfied with, so I decided to take this opportunity to write a class myself and maybe ...
1
vote
1answer
60 views

Power 8 AES implementation using built-ins

I need a review of an AltiVec/Power 8 AES implementation using built-ins to access in-core crypto. The program below is an implementation of FIPS 197, Appendix B. The hard-coded values are due to the ...
5
votes
1answer
5k views

Encrypt and decrypt a message using AES-256 with GCM mode using Bouncy Castle C# library

Goal: Given a plaintext message and 256 bit key, encrypt (and subsequently decrypt) the message using a 12 byte IV (in this case null bytes for simplicity, should not do this, I know) with MAC of ...
2
votes
0answers
361 views

Partial file encryption with AES

Task is to encrypt part of the file using aes encryption algorithm. I did ...
5
votes
1answer
3k views

Bouncy castle 128bit AES/CBC/PKCS7 in java

I have been trying to do some encryption-decryption using bouncy castle and with the available docs and samples on the internet I have managed to prepare the below. Though this works without throwing ...
6
votes
2answers
3k views

Encrypting files in a directory (AES)

I am quite new to Python (and programming in general). I was trying to create a command-line program for encrypting my files. Please tell me what I can improve (styling, crypto, etc.) Disclaimer: I ...
1
vote
1answer
253 views

CRT mode for AES

I needed to implement CRT mode for AES and coded following codes. But I am not an expert so I want to know experts comments that is it right or I made some mistake that will cause security problem. I ...
1
vote
2answers
9k views

AES Encryption/Decryption of Files and Bytes

I have gathered some information about aes256 in c# from the internet and put together this code and I would like to know if this is secure or if its lacking in security. Working encrypt/decrypt ...
3
votes
2answers
2k views

Sending a file over a socket with AES encryption

I'm not sure what's the best way to deal with streams that need to be closed whenever I'm done using them? Usually the need to also catch the exception inside the ...
1
vote
1answer
128 views

AES Java security

I am new to security and I was wondering if I can make my program better by changing or adding something to make it better/secure. Should I use a keyGenerator? I have my doubts from my program output....
2
votes
0answers
646 views

Wrapper/abstraction for encryption and decryption using OpenSSL

I am a beginner when it comes to cryptography and OpenSSL. I have written a short wrapper of some functions in OpenSSL as well as a test of this wrapper, copied below. Specifically, this code is ...
6
votes
1answer
2k views

AES encryption/decryption using pure .NET and streams

I'm trying my hand at simple encryption and decryption. Ideally I'd like to be doing it the 'right' way, ie something secure without doing it in a way that will have a serious hole. I'd prefer to do ...
5
votes
2answers
9k views

AES256 Implementation

I coded a little implementation to encrypt and decrypt bytes with AES256 (ECB) in C#. I wanted to know if I can optimize/cleanup my code a bit more, or if it i fine like this: ...
2
votes
1answer
109 views

Need help to make a more secure AES class

I've been working on my first "big" project in java, an AES encryption and decryption class, it's now working but i don't know how to improve my code. Also i'm not the best in security and I have no ...
2
votes
1answer
1k views

Making AES encryption in Go just a little easier

AES encryption in Go is already pretty simple, Gencrypt is a package that acts as a wrapper around Go's standard packages used for AES encryption to make it even more simple. https://gitlab.com/...
3
votes
0answers
990 views

Encode object to JSON and encrypt with AES (with tests)

While the task at hand is relatively straightforward, it turned out AES in Go is a bit clunky so I was wondering if this seems right. Also, any tips on Go coding in general are more than welcome. <...
5
votes
1answer
4k views

C# AES Encryption random IV per file

I've made some improvments on the code from : Csharp-AES-bits-Encryption-Library-with-Salt saltBytes is now the SHA512 of the password. Random IV for each encryption call. ( IV length 16 is added to ...
2
votes
1answer
82 views

Encrypting a user's file with a key that isn't stored but only known by the user

I want to make some kind of file vault. I want to store encrypted files in a MySQL table, and the key to encrypt/decrypt them is never stored but only known to the user (that's the goal, anyway). The ...