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 8246779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:37:10+00:00 2026-06-07T22:37:10+00:00

I have a long in my database. I like to encrypt it. I could

  • 0

I have a long in my database. I like to encrypt it. I could use xor but that is not very secure as a pattern can be seen and the xor value may be revealed. IIRC AES has a key and an initialize vector (IV) which can be thought as a seed (when talking about random numbers). I believe the IV should be randomly made. This is so a different pattern occurs when encrypting the same data with the key.

How might i securely encrypt 64bits? I suspect it may not be truely secure w/o a random IV/seed. But i do not want to store it. At the moment the other option i can think of is having a cryptographic RNG and running it say 10000 times if the value is the 10000th index then xor the value. But performance wise that doesn’t scale.

How do i properly and securely encrypt 64bits w/o storing extra bits for each 64bits? I’m thinking maybe feed a crypto RNG with (seed xor index) run it X times and xor that with the value. But i have a feeling someone has a better idea?

  • 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-06-07T22:37:12+00:00Added an answer on June 7, 2026 at 10:37 pm

    AES has a block size of 128 bits, so if you use that, you’ll end up encrypting as much padding as meaningful data.

    You could use DES (or, preferably, 3DES), since its block size is 64 bits.

    The initialization vector should be difficult for the attacker to predict, but it’s not actually secret like the key is, so it can be chosen algorithmically; see, for example, the ESSIV algorithm used to generate per-sector IVs for disk encryption. You could use the same scheme — just replace the “sector number” with something analogous like the record’s unique ID number — so you don’t actually have to store the IV, just regenerate it using the algorithm at decryption time. (But if you ever modify the record’s unique ID, make sure you decrypt and re-encrypt with the new IV!)

    You can avoid using an IV entirely if you encrypt using ECB mode, but that’s not really a good idea. For a given key, the same plaintext always encrypts to the same ciphertext in ECB mode, so an attacker would be able to see that your secret number is the same in two records even if he can’t determine the actual value. Assuming that you’re not using different keys for each record, you want to have a different IV for each record.

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

Sidebar

Related Questions

I have very long multidimensional array that have many sub arrays. I would like
With my database upgrade scripts, I typically just have one long script that makes
I have been told that searching in a MySQL database with LIKE '%wordend' is
I would like to have long random numbers as primary key in my database.
I have a very long list of Ids (integers) that represents all the items
I have a task that takes quite a long time. So I would like
I currently have a database that gets updated from a legacy application. I'd like
I have to store long strings in MySQL database using spring roo. I assumed
I have to send a long string of data through webservice to database.I odnt
So I have a database of words between 3 and 20 characters long. I

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.