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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:07:22+00:00 2026-05-25T06:07:22+00:00

I want to encode a number which would be maximal 10 digits long using

  • 0

I want to encode a number which would be maximal 10 digits long using a key with ASCII chars.

The encoded string should be decodable with the same key , which should return the decoded number.

10 => encoding_with("secret_pass") => hash => decoding_with("secret_pass") => 10

Both operations should work the same way in Javascript and Ruby.

What algorythm should I use for this purpose ?

All data should be in ASCII, no multibyte data for input, hash, and the key.

  • 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-25T06:07:23+00:00Added an answer on May 25, 2026 at 6:07 am

    A simple XOR should be sufficient.

    JavaScript

    Ruby

    Yes, you can go overboard and break out the full crypto suite, but since one part of the algorithm will run in-browser, in JS (completely untrusted environment), any attempt at Serious Cryptography™ will give you a false sense of security (in other words, will actually make your system less secure).

    If you’re trying to protect the data in transit, use the tool that’s made for the job; in this case, HTTPS.

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

Sidebar

Related Questions

I want to encode DNS protocol header using C and create a UDP datagram.
In Java, I have a String and I want to encode it as a
I have an AVI file, which I want to re-encode to fit on a
I want to find the successor of each element in my encoded string. For
So I have a UTF-8 encoded string which can contain full-width kanji, full-width kana,
i want to convert an utf-8 encoded web page source code downloaded using InternetReadFile
As the title mentioned, I want to encode a Image Obj into some kind
In my java app I'm preventing XSS attacks. I want to encode URL and
I want to do encode the data before saving it to a database table
I want to use the Html.Encode by replacing Name <%=Html.TextBox(Name, Model.projectModel.Name)%> However, since i`m

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.