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#
  4. Reversible Cipher Question

Reversible Cipher Question

Scheduled Pinned Locked Moved C#
questionsecurity
7 Posts 5 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.
  • P Offline
    P Offline
    paas
    wrote on last edited by
    #1

    Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...

    C D L 3 Replies Last reply
    0
    • P paas

      Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Decrypt it. Convert it to upper case. Re-encrypt it. You cannot convert it to upper case while it is in its encrypted state.


      Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

      1 Reply Last reply
      0
      • P paas

        Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #3

        do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE... or to capitalize the contents of the encrypted text while keeping it encrypted? The later as the other poster mentioned is impossible. The simplest way to do the former would be to map each 8 bit value onto one of the first 256 2 upper case character pairs. eg 0x00 = AA 0x01 = AB .. 0x1A = AZ 0x1B = BA ...

        -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

        P 1 Reply Last reply
        0
        • P paas

          Does anyone know of a cipher that will convert/encrypt any printable characters into all upper-case letters? Essentially I would like to be able to convert the output of a DES encryption, which can contain numbers, letters or special characters, into all upper-case letters. Does anyone know of any code, no matter how simple, that can provide that function? Thanks...

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Although not strictly letters, maybe a simple hex representation is sufficient, i.e. replace each encrypted byte by two characters in [0-9A-Z]. byte.ToString("X2") would do that for you. And byte.Parse(string, NumberFormat.HexNumber) would undo it. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


          D 1 Reply Last reply
          0
          • D Dan Neely

            do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE... or to capitalize the contents of the encrypted text while keeping it encrypted? The later as the other poster mentioned is impossible. The simplest way to do the former would be to map each 8 bit value onto one of the first 256 2 upper case character pairs. eg 0x00 = AA 0x01 = AB .. 0x1A = AZ 0x1B = BA ...

            -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

            P Offline
            P Offline
            paas
            wrote on last edited by
            #5

            dan neely wrote:

            do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE...

            Yes, and your suggestion should work fine for what I want to do... Thank you.

            M 1 Reply Last reply
            0
            • L Luc Pattyn

              Although not strictly letters, maybe a simple hex representation is sufficient, i.e. replace each encrypted byte by two characters in [0-9A-Z]. byte.ToString("X2") would do that for you. And byte.Parse(string, NumberFormat.HexNumber) would undo it. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #6

              If acceptable that'd be a better solution than mine, but I suspect the all uppercase letter requirement is due to interfacing with a crufty legacy system not new development that is potentially changeable.

              -- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.

              1 Reply Last reply
              0
              • P paas

                dan neely wrote:

                do you mean convert the crypttext into something that looks like ABLKSJFHUIWKLDHALSDHQWE...

                Yes, and your suggestion should work fine for what I want to do... Thank you.

                M Offline
                M Offline
                Mark Churchill
                wrote on last edited by
                #7

                Or you could try UUEncoding, which isnt exactly what you have requested, but at least you wont be reinventing the wheel.

                Mark Churchill Director Dunn & Churchill

                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