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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:27:03+00:00 2026-05-13T10:27:03+00:00

My recent turn-on is using BinaryFormatter instead of some database product. I have an

  • 0

My recent turn-on is using BinaryFormatter instead of some database product. I have an idea to write simple 64bit number into hardware dongle, and encrypt my files with it – via simple XOR operation. Just so it can’t be readable at some other end. Do I derive from Stream, or what?

I know I can simply put that number into the file and check against it on reading, but… I’ll feel better if it’s XORed all the way.

  • 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-13T10:27:04+00:00Added an answer on May 13, 2026 at 10:27 am

    I’m not going to comment on XOR encryption, that’s too silly. Lets focus on practical guidance to implement your custom stream. You should derive it from Stream so it has a familiar interface to the user. Right-click “Stream”, Implement Abstract Class. You can leave most of the NotImplementedException throws in place, streams are commonly crippled like this. Add a private FileStream member, it will do the hard work. Then add:

    • A contructor that takes a string argument, the path to the file. Construct the FileStream with it.
    • Implement CanWrite, return true.
    • Implement the Write() method. Do whatever you need to do to the byte[] that the client passed. You typically need your own byte[] buffer, call Flush() if it is getting too large. Or FileStream.Write() directly if you don’t need a buffer.
    • Implement the Flush method. Call FileStream.Write() for your buffer, then its Flush().
    • Implement Close and Dispose(), call the corresponding FileStream method.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recent conversations with colleagues have produced varying points of view on this matter. What
A recent question came up about using String.Format(). Part of my answer included a
This recent question about sorting randomly using C# got me thinking about the way
In a recent project I'm using a lot of databinding and xml-serialization. I'm using
Okay... I'm trying to use the most recent version of ITextSharp to turn an
How can i turn this: <? echo json_encode($myArrays); ?> ...into this: _rowData: [ {
I am attempting to create my first OS-level GUI using wxPython. I have the
I'm asking because PowerShell confuses me. I've been trying to write some deployment scripts
For a recent project a friend of mine and I have been working on,
For a recent project, I have a PHP script running as a CLI-based daemon.

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.