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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:10:07+00:00 2026-05-12T11:10:07+00:00

I have a desktop application that will ‘sync’ with an iPhone application. The sync

  • 0

I have a desktop application that will ‘sync’ with an iPhone application. The sync is actually a simple file copy — the iPhone app is a viewer, so I don’t have to deal with the complexities of actually syncing the data in a two-way manner.

I’ve written my own protocol since I need it to be lightweight, and I’m sending files that may be bigger than the RAM available on the device — therefore, the files are being streamed straight from the network to disk.

The files consist of one ‘data’ file (an SQLite database) and zero or more resources, which are pictures, PDFs, etc. Once the connection has been accepted, the client and the server communicate in chunks, which start with the following struct:

struct ChunkHeader {
    UInt32 headerLength;
    UInt32 totalChunkLength;
    UInt32 chunkType;
    UInt32 chunkNameLength;
    UInt32 chunkDataLength;
} __attribute__ ((packed));

After the struct comes a UTF-8 filename string immediately followed by the data for that file. The header struct contains the length of the filename string (chunkNameLength) and the length of the binary data length (chunkDataLength). chunkType contains the “type” of the chunk so the client knows what to do with the data, and can be one of the following:

typedef enum {
    kChunkTypePreSyncInfoDictionary = 0,
    kChunkTypeDataFile = 1,
    kChunkTypeResource = 2,
    kChunkTypeEndOfData = 3,
    kChunkTypeSyncCancelled = 4
} ChunkType;

Up to now, I haven’t taken security into account at all. The sync will take place over a local WiFi network, which may or may not be encrypted. The data being copied doesn’t contain sensitive information by its nature in the way a word processing document doesn’t — there’s nothing stopping the user entering sensitive details if they want to, but it isn’t asked for.

So, what steps should I take to ensure the data is adequately secure? I’m working in Objective-C, but I’m not looking for language-specific answers, just concepts. Things I’m worried about:

  • Should I take steps to prevent data spoofing?
  • Should I take steps to actually encrypt the data?
  • Should I take steps to ensure another application doesn’t pretend to be my app and replace either the client or server with something else?
  • Should I take steps to check the received data for something that causes damage?
  • 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-12T11:10:08+00:00Added an answer on May 12, 2026 at 11:10 am

    “Should I take steps to check the received data for something that causes damage?”

    Always. Unconditionally. Without Exception.

    For your other questions:

    • Should I take steps to prevent data spoofing?

    • Should I take steps to actually encrypt the data? (snooping)

    • Should I take steps to ensure another application doesn’t pretend to be my app and replace either the client or server with something else? (spoofing again)

    You said “The data being copied doesn’t contain sensitive information” so snooping seems not to be a threat scenario you care about.

    So, it looks like you’re worried about some spoofing threat scenario (you mentioned it twice).

    This is usually handled with some kind of exchange of credentials between client and server. Passwords work for user authentication. Some kind of certificate might work for client-server mutual trust.

    The idea is to have “enough” information for the client and server to know the other party is trustworthy. Some folks are happy with a known URL. Other folks want some “shared secret” (like a password). Some folks need even more, and include numerous details in the protocol. Some folks include algorithmic details in the protocol (HTTP Digest Authentication, for example, requires the client to do a little algorithmic dance on data provided by the server.)

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

Sidebar

Ask A Question

Stats

  • Questions 202k
  • Answers 202k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Default sales invoice report is in AOT>Reports>SalesInvoice. This is not… May 12, 2026 at 8:28 pm
  • Editorial Team
    Editorial Team added an answer What version of EPiServer are you using? There was an… May 12, 2026 at 8:28 pm
  • Editorial Team
    Editorial Team added an answer I think you need partial rendering which is provided by… May 12, 2026 at 8:28 pm

Related Questions

I have a desktop application that will 'sync' with an iPhone application. The sync
I have a desktop (winforms) application that uses a Firebird database as a data
Which is the best API to use when accessing a WebCam in .Net? (I
We have a WPF Application that has a two flavors with a consistent UI
Recently, I have become increasingly familiar with Django. I have a new project that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.