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

  • Home
  • SEARCH
  • 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 6997347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:16:19+00:00 2026-05-27T20:16:19+00:00

I have a system that needs to send and receive data over an insecure

  • 0

I have a system that needs to send and receive data over an insecure channel. I want to keep this simple (it’s running on an embedded platform, not a PC), and I don’t mind if an attacker can read the data. What I want to prevent is an attacker intercepting the data and modifying it.

The platform has built-in functions for hashing (MD5, SHA1, etc), but not encryption, so what I thought I’d do is simply hash the data concatenated with some secret data to ensure that it was generated by my system and not an attacker. For example:

dataToSend = dataString + sha1(dataString + secretString)

The data string is sent in plaintext, followed by the hash. The secret part means that an attacker can’t modify the data without invalidating the hash, unless they somehow discover the secret, which is built into the program and never sent over the channel. I’m aware that this scheme is susceptible to replay attacks; that’s not a problem for this particular application.

My question is: if the secret is built into the app and never changes, is there a way someone could work out what it is, if they had a large collection of intercepted data strings and hashes? The executable the secret will be embedded in is itself encrypted by the platform, so there’s no chance of discovering the secret with a hex editor.

Secondly, does it matter how long the secret is? The data string will typically be 8 bytes. If I have a much longer secret (e.g. 1024 bytes), to try to make it unguessable, then most of the input to the hash algorithm will never change. Does this make it less secure somehow?

Thanks!

  • 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-27T20:16:20+00:00Added an answer on May 27, 2026 at 8:16 pm

    The standard technique for keyed authentication is HMAC. Unless you have specific reasons to do otherwise, I suggest you use HMAC for your problem.

    Having the key longer than the data is a very good idea. Your data is 64 bits, so using HMAC-SHA-256 would give a 256 bit key, twice as long as your data. You could use a different key size if you wanted to, HMACs are pretty flexible about what size of key they accept.

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

Sidebar

Related Questions

I currently have designed a system for simple send message receive message using such
We have an embedded device that needs to interact with an enterprise software system.
We have a system that has a Mysql database with about 2Gigs of data.
I have a system that takes dynamic data, puts it in HTML for layout
I'm building a system that will send verses of scripture to subscribers over e-mail.
I have two system calls GetSystemTime() and GetThreadTimes() that I need to calculate the
We have system here that uses Java JNI to call a function in a
I have a system that combines the best and worst of Java and PHP.
I have a system that uses a meta refresh to a logout page, which
I have a system that creates an order and that order can be billed

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.