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

The Archive Base Latest Questions

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

I was looking for examples how to encode stuff in C using DES cypher

  • 0

I was looking for examples how to encode stuff in C using DES cypher and openssl headers and I found this one: http://www.codealias.info/technotes/des_encryption_using_openssl_a_simple_example

The code is almost perfect but I’m not so expert in this stuff and my C knowledge in C is not so big since I use it on PIC and AVR micro controllers…

Anyway in the code:

printf("Clear text\t : %s \n",clear);
memcpy(encrypted,Encrypt(key,clear,sizeof(clear)), sizeof(clear));
printf("Encrypted text\t : %s \n",encrypted);
memcpy(decrypted,Decrypt(key,encrypted,sizeof(clear)), sizeof(clear));
printf("Decrypted text\t : %s \n",decrypted);

As you can see, sizeof(clear) is used as the size of the string… the problem is that on the example we know the size of the text string… but when I’m sending this text over the network the other computer don’t know it…

How can solve this issue… I don’t understand so well why I need to have the size of the original string to decrypt :S

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

    The world is full of bad security systems designed by people who read Applied Cryptography.

    Don’t send your own ‘encryptyed’ stuff on wire. You’re missing an HMAC, you’re missing a key exchange protocol, you’re missing a wire frame protocol (which is exactly the answer to your question ‘how do I know the size’). Just use an off-the-shelf protocol like TLS/SSL. gnu-tls offers a easy to use API for SSL/TLS, openssl also supports it but is notoriously cumbersome to use. Whatever you do, don’t start writing your own protocol, you’ll come up with yet another broken ‘encryption’ protocol because of a bad key exchange or a ‘optimized nonce’ or a missing frame signature or whatever.

    Here is a simple example using gnu-tls: Simple client example using the C++ API

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

Sidebar

Related Questions

I've been looking at examples of REST API's like Netflix http://developer.netflix.com/docs/REST_API_Reference#0_59705 and Twitter and
I'm looking for examples where a human-based service replaced an automated one. For example,
I am looking for any examples or guides to using Linq over WCF (n-tier
Looking at examples and tutorials for some MVC libraries for web development on the
Looking at examples about socket programming, we can see that some people use AF_INET
I'm looking for examples of specifying files in a tree structure, for example, for
I'm looking for examples of processing.js working in Internet Explorer via ExplorerCanvas or similar.
I am looking for basic examples/tutorials on: How to write/compile libraries in C++ (
I'm looking for (simple) examples of problems for which JMS is a good solution,
I am looking for some examples of a .bat OR .wsh script that can

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.