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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:13:30+00:00 2026-05-24T14:13:30+00:00

I need to find a way to (preferably asymmetrically)[1] encrypt/decrypt a single Int32, with

  • 0

I need to find a way to (preferably asymmetrically)[1] encrypt/decrypt a single Int32, with the resulting encrypted value containing only valid characters[2] and being under eleven characters in length.

How would I go about doing this?

[1] Given the answers so far, symmetric encryption is fine

[2] alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()

  • 1 1 Answer
  • 1 View
  • 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-24T14:13:31+00:00Added an answer on May 24, 2026 at 2:13 pm

    as another answer says, an asymmetric solution is difficult and your best, standard solution is to use a symmetric cipher with a short block size. your restriction to ten characters implies 60 bits with base 64, but you could use a custom encoding to get 64 bits (with a block cipher you need to send an exact number of blocks).

    if you use a 64 bit block size you will have to fix the IV. in other words, if you send the same number twice, it will be encoded the same way both times [not true! – see neat idea in comments below]. but with a 32 bit block cipher you could use a random IV (padding to hide repeated values). it looks like skip32 would be a good choice – see Which "good" block encryption algorithm has the shortest output?

    another, ad-hoc idea, that i just pulled out my ass, and which may therefore be insecure is to split your message into two: 32bits and the rest. fill the rest with a random value, which you use as a (zero-padded, if necessary) seed to any stream cipher (http://en.wikipedia.org/wiki/Stream_cipher) then xor the value you want to encrypt with the first 32 bits of that (so your final message is the 32bits xor result, plus the random seed).

    finally, i have no idea why everyone is convinced that these messages will/should/must be insecure. the security does not depend on the message size (it is the key size that is important). as far as i know, small blocks are only weak against long messages. here you do not have a long message (there’s an important difference between able to guess a single message in 2^32 and knowing all messages after a similar “small” number of guesses).

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

Sidebar

Related Questions

I need to find a way to crawl one of our company's web applications
I need to find a way to get at the request/response streams inside of
I need to find a way to hide HTML Rows (or Tables) from view
I need to find a way to monitor the status of a list of
I need to find a way to spin off a thread from a static
I need to find a way to call a vb.net function in my aspx
I need to find some way of displaying a drop-down menu that depending on
I need to find a way to be notified when a System.IO.Pipe.NamedPipeServerStream opened in
I need to find a way to store 250 KB of plain text numbers
I need to find a way to use with(nolock) in every SELECT I do

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.