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. Secure storage

Secure storage

Scheduled Pinned Locked Moved C#
csharpc++jsonhelp
21 Posts 4 Posters 1 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 Lost User

    harold aptroot wrote:

    surely the OP would have thought of them..

    Assumptions, my dear Watson :) ..I don't expect that the API will save directly to a blob, I'd expect one to get an array of bytes. And yes, those could be securely stored in a blob.

    I are Troll :suss:

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #7

    If you get an array then there is no problem, he could just make the image of that without going through disc, so it can't be that either btw, I'm just assuming "OP is not an idiot" - I'm sure he will correct me if I'm wrong..

    L 1 Reply Last reply
    0
    • L L Viljoen

      Hi I have an application that uses a 3rd party API that saves a fingerprint image to file,I cannot retrieve the image in any way to a image object in the programming code so I need to save it to disk before i can load it into an Image object to convert the minutiae template between different vendor types. Now due to information law I need to protect that saved fingerprint image, even for the split second it is on the drive before i delete it So I need to know is there a way I can either Create a folder, storage space I can save to that only my Assembly can access. or Create a virtual drive that encrypts data that gets written into it. or Create a folder that requires a password to access it (which I can parse through my program). Primarily i am using C# to code this application but any C++ console wrapped app that can be of use to me would also help. Any advice or help will be appreciated. Hitting my head against the wall on this one Chona1171 Web Developer (C#), Silverlight

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

      if you have the image as a byte array, there are at least two Bitmap constructors that might help you: 1. one takes a stream, any stream, so store the bytes in a MemoryStream and take it from there (don't forget to "rewind" your stream, i.e. position it at zero after writing it) 2. another takes an IntPtr to the raw data. This needs unsafe code, and/or fixed, and/or GCHandle. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

      L 1 Reply Last reply
      0
      • L Lost User

        If you get an array then there is no problem, he could just make the image of that without going through disc, so it can't be that either btw, I'm just assuming "OP is not an idiot" - I'm sure he will correct me if I'm wrong..

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #9

        harold aptroot wrote:

        he could just make the image of that without going through disc

        Yup. Hence the question how the 3d party library supplies the image. If it's in memory, then it can be encrypted, but that doesn't guarantee it not being written to disc. A SecureString for bitmaps?

        I are Troll :suss:

        L 1 Reply Last reply
        0
        • L Lost User

          harold aptroot wrote:

          he could just make the image of that without going through disc

          Yup. Hence the question how the 3d party library supplies the image. If it's in memory, then it can be encrypted, but that doesn't guarantee it not being written to disc. A SecureString for bitmaps?

          I are Troll :suss:

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #10

          What if he disables the pagefile?

          L 1 Reply Last reply
          0
          • L Lost User

            What if he disables the pagefile?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #11

            Guess that'd be safer. It would be a major handicap for a fingerprintingdevice if you couldn't use it on a system that uses virtual memory though. Nah, it's prolly just an array of bytes in memory that need be transformed to a bitmap, with the restriction of not using temporary files. Must be a good time to get some sleep :)

            I are Troll :suss:

            1 Reply Last reply
            0
            • L Lost User

              Chona1171 wrote:

              I cannot retrieve the image in any way to a image object in the programming code so I need to save it to disk before i can load it into an Image object to convert the minutiae template between different vendor types.

              How does the API return the image?

              Chona1171 wrote:

              So I need to know is there a way I can eitherCreate a folder, storage space I can save to that only my Assembly can access.orCreate a virtual drive that encrypts data that gets written into it.orCreate a folder that requires a password to access it (which I can parse through my program).

              SqlCe or SqlExpress, using a blob-field. Or use the encryption-routines that come with .NET.

              I are Troll :suss:

              L Offline
              L Offline
              L Viljoen
              wrote on last edited by
              #12

              the only way it returns an image is a save command with only 1 overload allowing me to save the file to a path. Chona1171 Web Developer (C#), Silverlight

              L 1 Reply Last reply
              0
              • L Lost User

                harold aptroot wrote:

                surely the OP would have thought of them..

                Assumptions, my dear Watson :) ..I don't expect that the API will save directly to a blob, I'd expect one to get an array of bytes. And yes, those could be securely stored in a blob.

                I are Troll :suss:

                L Offline
                L Offline
                L Viljoen
                wrote on last edited by
                #13

                Thats exactly it you do not get an array of bytes. the only image Method available on the entire API is Save Chona1171 Web Developer (C#), Silverlight

                1 Reply Last reply
                0
                • L Lost User

                  What exactly does the law require?

                  L Offline
                  L Offline
                  L Viljoen
                  wrote on last edited by
                  #14

                  The law requires any and all personal information of an employee that gets saved to disk (id numbers, details ect) needs to be encrypted, or protected In Europe the law currently states that it includes fingerprints, and soon it will be law here in SA. Now my problem is when the image gets saved to the disk it gets saved as a clear image hence the fact that i need to save it somewhere where no one via the windows shell or dos can get a hold of it even for that split second before it gets pulled back up in memory(Using the Image object i need) and deleted from disk Chona1171 Web Developer (C#), Silverlight

                  L 1 Reply Last reply
                  0
                  • S Stoffy1972

                    Something that may help you is the Namespace System.IO.IsolatedStorage, for example IsolatedStorageFile-Class. Sorry, no time to do some tests but read this[^] to get an idea.

                    L Offline
                    L Offline
                    L Viljoen
                    wrote on last edited by
                    #15

                    Isolated storage requires me to have the image allready loaded to an object and then to convert it to a byte array. My main problem is that the 3rd party API only allows me to get the image by storing it in a directory. Chona1171 Web Developer (C#), Silverlight

                    1 Reply Last reply
                    0
                    • L L Viljoen

                      the only way it returns an image is a save command with only 1 overload allowing me to save the file to a path. Chona1171 Web Developer (C#), Silverlight

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #16

                      An encrypted volume (think TrueCrypt) would be overkill, but I can't think of any alternatives.

                      I are Troll :suss:

                      1 Reply Last reply
                      0
                      • L L Viljoen

                        The law requires any and all personal information of an employee that gets saved to disk (id numbers, details ect) needs to be encrypted, or protected In Europe the law currently states that it includes fingerprints, and soon it will be law here in SA. Now my problem is when the image gets saved to the disk it gets saved as a clear image hence the fact that i need to save it somewhere where no one via the windows shell or dos can get a hold of it even for that split second before it gets pulled back up in memory(Using the Image object i need) and deleted from disk Chona1171 Web Developer (C#), Silverlight

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #17

                        What are the limits of this "save" function? Can it save to a named pipe?

                        L 1 Reply Last reply
                        0
                        • L Lost User

                          What are the limits of this "save" function? Can it save to a named pipe?

                          L Offline
                          L Offline
                          L Viljoen
                          wrote on last edited by
                          #18

                          No only 1 save and its save to directory. Chona1171 Web Developer (C#), Silverlight

                          L 1 Reply Last reply
                          0
                          • L L Viljoen

                            No only 1 save and its save to directory. Chona1171 Web Developer (C#), Silverlight

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #19

                            What happens if you put in a path to a named pipe anyway? Crash?

                            L 1 Reply Last reply
                            0
                            • L Luc Pattyn

                              if you have the image as a byte array, there are at least two Bitmap constructors that might help you: 1. one takes a stream, any stream, so store the bytes in a MemoryStream and take it from there (don't forget to "rewind" your stream, i.e. position it at zero after writing it) 2. another takes an IntPtr to the raw data. This needs unsafe code, and/or fixed, and/or GCHandle. :)

                              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                              L Offline
                              L Offline
                              L Viljoen
                              wrote on last edited by
                              #20

                              Thank you for all your help I was able to retrieve the raw data, though i had trouble could not use a memory stream to write it into an image field i had to take the image loop through the byte array which will be the same length as the width and height of the acquired image maye a 2D loop and take the byte array and read it back as a color onto a bitmap . That solved my problem Though thanks for all the posts and all the help, the Truecrypt example will be usefull to me in other application i am developing and the named pipes solution is also one i will consider. Thanx to all Chona1171 Web Developer (C#), Silverlight

                              1 Reply Last reply
                              0
                              • L Lost User

                                What happens if you put in a path to a named pipe anyway? Crash?

                                L Offline
                                L Offline
                                L Viljoen
                                wrote on last edited by
                                #21

                                To be honest i haven't tried it but i will give it a go , I read an article about ti and it looks very interesting. Chona1171 Web Developer (C#), Silverlight

                                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