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?