Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7662169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:43:57+00:00 2026-05-31T13:43:57+00:00

I am working on a project that involves sending some very small encrypted messages

  • 0

I am working on a project that involves sending some very small encrypted messages over a high performance socket connection using UDP. I have read in other posts that the bare minimum number of bytes that AES should encrypt with a 128 bit key is the block size, which is 16 bytes.

But, the real question is – is that enough to provide good protection? I am thinking about using a scheme that would add some random data to the message and get a random number between 1 and 12 which would be used to place the 4 bytes of real data within the block. The zero byte in the block would be the random number which is the starting position in the block of the 4 bytes. After building the block, it would be encrypted with AES using a 128 bit key. The data does not have any value after the client disconnects, and connections should not last more than 24 – 48 hours at the most. Will something like this work, or should I send more data to make it harder for a potential adversary to break?

I also will be encrypting other data that does need to be protected after the user disconnects like credit card numbers, bank account info, password hash, etc. I am planning on using AES with 256 bit keys for that. So, same question for this case – what is the minimum number of bytes that should be encrypted to provide good protection for 256 bit keys? Will 16 bytes suffice, or would 32 be better?

I am planning on using bouncy castle’s fast AES engine for the small messages. See:

http://www.bouncycastle.org/csharp/index.html

http://www.bouncycastle.org/docs/docs1.6/org/bouncycastle/crypto/engines/AESFastEngine.html?is-external=true

For the 256 bit AES encryption, I am thinking of using RijndaelManaged since it seems to have better security features on the server and performance is not much of an issue for these infrequent transactions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:43:58+00:00Added an answer on May 31, 2026 at 1:43 pm

    First of all, the less cipher text, the less it it susceptible for attacks. It seems you think it is the other way around.

    For UDP I would highly recommend to look into counter mode encryption. The advantages is that the key stream can be pre-calculated, which makes for low latency encryption/decryption. It does not require padding either, so you don’t have to send more data than required (note that you have a side channel regarding data length, so the difference between “Yes” and “No” can be clearly seen). You do need a good NONCE though.

    If you want integrity protection, then GCM mode encryption would be highly advisable. If it is not available, take a look at HMAC or MAC over your cipher text – but you will require two secret keys instead of just the one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a small project that involves me loading an image into a
I'm in the process of working on programming project that involves some pretty extensive
The project that I've been working on involves porting some old code. Right now
I'm working on a small project that involves grabbing a list of contacts which
I'm working on a project that involves some home-made (de-)serialization code, and I have
I'm working on a project that involves some scripting and data storage. The database
I am working on a project that involves an embedded system which runs a
I'm working on a project that involves converting a large amount of HTML content
I'm working on a home project that involves comparing images to a database of
I am working on a project right now that involves receiving a message from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.