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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:43:53+00:00 2026-05-24T18:43:53+00:00

I have a competition that people can enter with a secret code they discover

  • 0

I have a competition that people can enter with a secret code they discover in an Android app. The method I have chosen to ensure only people who have purchased the app can enter the competition is to use shared secret encoded(encrypted?) with HMAC SHA256.

So my secret will be encrypted in C in the Android app (using Crypto++, do you have any suggestions of a beter SHA library? I am finding Crypto++ really hard to use).

This is just an example:

Unencrypted shared secret = "my shared secret"  
Unencrypted secret code   = "abcdef"  
Encrypted shared secret   = "dsgdfgdfgdfgfdgf"   
Encrypted shared secret   = "ddffgdgdf"

So when the user discovers the secret code they will be taken to a webpage(python script) & the HMAC encrypted shared secret will be passed as a CGI parameter:

http://mysite/competition.py?encodedSecret=3dfdfdg343jkfjk390kl

Then my python script will look at the CGI parameter & decrypt it to get the shared secret(to verify that the competition entry is from a user who has the app) & the secret code(to see if the user has won anything).

My Question is: Is it possible for a python script(using hashlib module) to decrypt something that was encrypted in C using Crypto++?

  • 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-24T18:43:54+00:00Added an answer on May 24, 2026 at 6:43 pm

    When using a hash that way, normally you would pass the secret code (in plaintext) and the hash of both the secret code and the shared secret to your web site. The web site can then perform the same hash (as it knows the shared secret), and verify that the result is the same.

    ‘Cracking’ the hash on your server is a lot of extra work, and I don’t see how it adds any security.

    If you must not transmit the code in plaintext, it would be much more efficient to use your shared secret as the key in a symmetric encryption algorithm (e.g. AES).

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

Sidebar

Related Questions

I have an Android Mobile App that is really just a calendar & you
I have an Interface called IStep that can do some computation (See Execution in
I've started working on some Android applications and have a question regarding how people
I am analyzing some .net desktop application. I have found that code: if (System.Environment.ProcessorCount
I have a problem that I have been thinking about, but I can't really
I have the following models & mappings (code snippets further below). One Competition has
I've got a simple Django photography competition app that has three simple model definitions:
I have a reasonably advanced (many patches and subpatches) quartz composition that was created
I was looking at what the guys in the Mario AI Competition have been
I've been practicing for an upcoming programming competition and I have stumbled across a

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.