People who code: we want your input. Take the Survey

Questions tagged [aes]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
366 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 ...
4
votes
2answers
4k 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
2k 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). ...
21
votes
3answers
522 views

Encryption functions based on mcrypt

I learned here that it is unsafe to design encryption algorithms from scratch. Given that advice, I made a pair of encryption functions based on mcrypt: ...
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[]? ...
5
votes
1answer
401 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 ...
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
782 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
2k 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 ...
2
votes
2answers
4k 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 ...
5
votes
1answer
10k 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 ...
1
vote
1answer
72 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 ...
2
votes
0answers
424 views

Partial file encryption with AES

Task is to encrypt part of the file using aes encryption algorithm. I did ...
1
vote
2answers
12k 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 ...
5
votes
1answer
4k 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
4k 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
305 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 ...
5
votes
2answers
26k views

Encrypt and decrypt a serializable object

I want to make sure that the code I have for encrypting and decrypting a serializable object makes sense and is proper. Does it look right too? Here's what I have so far: ...
3
votes
2answers
3k 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
131 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
768 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 ...
3
votes
1answer
2k 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/...
8
votes
2answers
13k 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
122 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 ...
6
votes
2answers
19k views

AES Encryption C# .NET

I have written a tool for encrypting string using the AesCryptoServiceProvider in .NET. The folllowing parameters are used: Block Cipher Mode: CBC Initialization Vector: 16 bytes (randomized per ...
4
votes
0answers
2k 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. <...
4
votes
1answer
312 views

AES Encryption/Decryption

Where I currently work I'm tasked with writing a good encryption and decryption code which will have DEK as well as KEK. Haven't started on KEK yet. I have already told them, that we need expert help, ...
4
votes
1answer
1k views

Implementing RSA-AES encryption protocol

I am trying to write a simple program that allows to encrypt a string of plaintext so that it can be transmitted via an "insecure channel" by which I mean a "regular chat"; be it Skype, Facebook, or ...
2
votes
1answer
83 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 ...
3
votes
1answer
246 views

Encryption functions intended for production

I want to know if these encryption functions are ok for a live production application. Based on resources here and here and here I have put together these three functions. Purpose This code is for a ...
2
votes
1answer
8k views

AES-128 Encryption/Decryption of NSData

I recently found an Objective-C extension on NSData that encodes and decodes data with AES-128. I made an attempt to port this code to Swift 2.2: NSData+AES.swift ...
18
votes
2answers
18k views

C# AES + RSA Encryption Implementation

I've put together an AES encryption implementation to solve a set of requirements. I believe that I've met the requirements, but I'd like to see if anyone is willing to review the implementation to ...
3
votes
2answers
629 views

AES class security

I am using the AES class (which I think I got from another post on Stack Overflow) for encrypting strings to a database. How robust and secure (would it be easy to break) is this class? Is there any ...
3
votes
2answers
309 views

Intel® TinyCrypt: AES-128/CTR to encryption/decryption of 2D arrays

I need to encrypt/decrypt 2D arrays (double pointers) using AES-128/CTR using Intel TinyCrypt (written in C). The following are two helper methods to simplify the library usage. Any comments would be ...
8
votes
3answers
4k views

Implementing AES encryption in Java

I'm not a security expert, but while checking over our AES implementation for our flagship product, I've noticed some strange things, like the output length having a relation with the input length and ...
10
votes
3answers
7k views

VB.NET code to AES encrypt and decrypt

I wrote this for use internally at work and have never worked with encrypted data before, so can you please critique? It's written in VB.NET which I have decent experience in, just not the encryption ...
5
votes
1answer
923 views

PyCrypto AES-256 CTR wrapper secure for public use?

I have tried to write a more user-friendly AES CTR wrapper with PyCrypto, but I'm not sure if it's safe enough. I mean, by default there is IV=1 for CTR and in documentation it's said that IV is ...
3
votes
2answers
210 views

File-encryption utility application

I made a simple file-encryption utility application for a little school project. I'm really interested in cryptography, and tried my best while making it. Can you see it, and give me feedback? The ...
0
votes
1answer
1k views

AES 256 FIPS compliant encryption + HMACSHA256

I created an Encryption class that encrypts data and decrypts it using the AesCryptoServiceProvider class with an HMACSHA256 ...
4
votes
1answer
54 views

AES Wrap function

This code is supposed to implement RFC 3394 which also described in this PDF at page 11. Are there any weak places or formatting issues in attached source? Or maybe some places are not explicit ...
5
votes
2answers
5k views

AES CTR mode using pycrypto

I've implemented CTR mode by myself (only decryption for now), using only AES built-in functions from pycrypto. It means that I'm not supposed to use mode=AES.MODE_CTR. However, I know that using AES....
2
votes
0answers
91 views

Rijndael key expansion

I am writing Rijndael for academic purpose, following wikipedia's description. https://en.wikipedia.org/wiki/Rijndael_key_schedule I would like to know, if up to this point it is correct, both from ...
4
votes
2answers
4k views

AES and RSA using javax.crypto

So I am assuming that I did something wrong, and my AES and RSA encryption and decryption classes are insecure. I plan on using them for a larger project, and want to make sure I didn't completely ...
53
votes
3answers
52k views

Simplified secure encryption of a String

I have two code examples that I wrote for best practices encrypting a string that I'm looking for feedback both in terms of best practices and security. They are both using authenticated encryption. ...
3
votes
1answer
664 views

Encrypt and Decrypt

I just want to know if my code can be weak. Can anyone also spot a mistake in my code? Encrypt ...
-4
votes
2answers
377 views

Saving encrypted files

...
6
votes
1answer
731 views

AES encryption wrapper

After taking into account answers for my questions here and here I created (well may-be) improved version of my wrapper. The key issue was what if an attacker is knowing what is encoded - he might ...
13
votes
2answers
1k views

PHP mcrypt AES encryption wrapper

There are two keys: the main is aes128 and the second is XTEA, used just for randomization of data inside the AES. Randomization is done with secret random key that is not know even if someone knows ...
5
votes
1answer
1k views

Implementation of AES using CUDA

I am trying to implement AES on GPU using CUDA programming. I use 4 TBoxes in my implementation that requires 4kB of GPU Memory. I have used a 1KB array for 1KB plaintext. first all of plaintext would ...