Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Text Encryption for text editor on the save button

Text Encryption for text editor on the save button

Scheduled Pinned Locked Moved C / C++ / MFC
c++delphisecurityquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I am new to all this and have made a text editor ( one of the most easy things to start with ) but i want it to save an encrypted file that no other text editor could read, so when you click save it asks for a password the saves the encrypted text then when someone tries to load it they have to enter the password?? Thanks in advance Steven Richardson! P.S. i have Borland C++ Builder 5

    N 1 Reply Last reply
    0
    • L Lost User

      I am new to all this and have made a text editor ( one of the most easy things to start with ) but i want it to save an encrypted file that no other text editor could read, so when you click save it asks for a password the saves the encrypted text then when someone tries to load it they have to enter the password?? Thanks in advance Steven Richardson! P.S. i have Borland C++ Builder 5

      N Offline
      N Offline
      Navier
      wrote on last edited by
      #2

      How long is a piece of string? A really easy way to do it is just to take the raw text and XOR each byte with a constant byte value. That turns the text into garbage. Then you check the password. If it matches you XOR each byte of the garbage with the same constant byte and voila your original text is back. Example: Encryption - 101 xor 011 = 110 Decryption - 110 xor 011 = 101 This is really insecure but it's dead easy. It depends on what level of security you need. If you're just looking for something to stop casual observers then this will do the trick but if you expect someone to expend some effort in cracking your encrypted text and it's security is important then you need to look for something more significant than this. There are plenty of industrial strength algorithms about but I'm no expert on current practices. Just google for 'encryption' for details. The other potential problem with what you propose is that your security model is trivially broken if the password is revealed. Look for 'public key encryption' to avoid this. HTH i1.2sqrt(u).bcos(ur)sec(c) but b4.isqrt(u).ru/16 Navier

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups