A
Andy B
Is there a way that is already built into .net 3.5 that will let me protect
an object from being modified when the object is public?
an object from being modified when the object is public?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Is there a way that is already built into .net 3.5 that will let me protect
an object from being modified when the object is public?
Good question. I never did think about doing that - Just serialize therest of the object?
I am trying to figure out the different ways of making an objectAs far as the mutability issue goes, I hope you see why your question
didn't really describe what you're trying to do. As long as the object is
an object, you have the ability in your own code to prevent any changes
from being made to the object when it's "signed". That much would be
simple.
The object would be serialized into an XmlDocument object and then given toAs soon as the object is serialized, it's no longer an instance of your
actual object, and you have no control over that data (other than whatever
normal control >mechanisms might exist...these would not be particular to
.NET though).
I considered using some sort of encrypting format to prove signing, AnyFor what it's worth, it seems to me that if your object really is
"signed", then that means you've use some sort of crypto technique to sign
the object. If you've >done it in a valid way, then it should actually be
impossible to change the data of the object when it's externalized.
That's what I figured in the last section.For example, if you encrypt the object's data as stored in the database,
or at least the data that's important to you with respect to not being
changed, then >outsiders could not modify the object.
Oh, yea. Security issues are always fun. NOT! On the note of security, InOf course, once you start down that road, you run into the usual computer
security issues. A particular problem is that unless you have complete
control over the >execution environment of your code, you have no way to
ensure that it won't be reverse engineered in order to get the encryption
key. That's literally an >impossible problem to solve.
This is a series of web applications that will use the objects in question.Perhaps you could be more clear about what your actual goal is. Lots of
applications get by without any strong guarantee that the data can't be
modified. When >the data is modified, it usually manifests itself as
simply a case where the user can change the data behind the program's back,
or the data winds up being >invalidated. These are usually acceptable
outcomes.
See above for project explanation to the best of my legal ability.It would help to answer your question if you could be more clear about why
it is you need this functionality, what you expect to gain from it, and to
what extent >do you need any guarantees as to the success of this
strategy. If you could also explain what "signed" means in this context,
that would be helpful (inasmuch as it >doesn't seem to fit the usual
meaning, since if it did, you wouldn't be asking the question).
Peter Duniho said:[...]
The object would be serialized into an XmlDocument object and then given
to
the business/validation layer of the code.
As soon as that happens, you lose control of the object per se. Even in
your own object class, there's not really anything you can do from a C#
point of view to ensure that the object doesn't change. C# provides
mechanisms, as mentioned earlier in the thread, to prevent regular .NET
code from modifying the object. But users can always get at the object
via reflection, and will always be able to modify members of the class
instances that way.
[...]
I considered using some sort of encrypting format to prove signing, Any
ideas on what to use and how to use it? What do you mean if it is done
in a
valid way? The signing or the encrypting?
Well, both. But I was mainly referring to the signing. I take as granted
that if you're going to use encryption, you'll take the time to learn how
to do it right. In the context of computer documents, "signing" has a
very specific meaning. For it to be valid, it has to ensure that the
document hasn't been modified (except possibly by the owner of the
signature).
I am assuming that externalizing
the object means to make it available outside the intended environment
it is
supposed to be used in (like an xml file for example)?
Yes, that's what I meant.
[...]
Oh, yea. Security issues are always fun. NOT! On the note of security, In
order to access the serialized objects that are inside the database,
there
will have to be some user authentication in place. I have some ideas to
try
and keep the security keys and stuff to a low minimum, but I'm pretty
sure a
pro hacker would be able to figure anything out. I might not be able to
use
the ideas in full, but do you have any good security tips and stuff when
it
comes to authentication?
No, not really. I don't have enough experience in that area to say that I
can offer anything other than the basics. And if you've given this
problem any thought at all, there's a good possibility you already know
whatever I might mention.
Just in case though, I'll point out that user authentication only address
signing in a strong way if there is some encrypted data available only to
authenticated users that's involved in the signing. That is, it's well
and good to have user authentication, but you have to keep in mind that
there are other routes to the data than going through an authenticated
user. The data itself needs to be protected.
As an example, the NTFS file system includes a security model that allows
you to define access rights to a file based on the user. However, this is
entirely enforced by Windows. There's no requirement that something
reading the file system obey those access rights, and in fact I know of at
least one NTFS implementation that doesn't. So Windows addresses this by
allowing users to also encrypt files. Windows uses the user's password
somehow (I don't know the specifics), and so only users that have provided
that password can decrypt the data.
Depending on your needs, you don't have to encrypt _all_ of the data. But
you do need to use some sort of encryption of data that's tied to the
document contents. See PGP for an example of that.
This is a series of web applications that will use the objects in
question.
I have to write a document signing service for customers to be able to
sign
the documents (objects) in question. This document signing service needs
to
comply with the ELECTRONIC SIGNATURES IN GLOBAL AND NATIONAL COMMERCE ACT
(www.ftc.gov/os/2001/06/esign7.htm).
I took a quick look at the link. For what it's worth, I didn't see
anything that looked like specific standards to which you would comply.
Did I miss something? The document looks more like a description as to
the who and why of document signing, and includes some sort of agenda for
a conference in which those issues are discussed.
Just invalidating the object, or
letting somebody be able to change the data behind the programs back
can't
be allowed. For every one's sake, the objects (documents) have to be as
secured as possible. This means doing whatever possible to make sure that
once the document is signed, that it can't be changed in any way except
for
setting state bits on it like paid in full or fulfilled in the case of a
contract. There would have to be user authentication (like mentioned
above)
where only the person that signed the document can see it. This is the
very
basic plan. It is more complex than this - but for security reasons, I
can't
say any more about the service design.
Assuming that part of the design is to ensure that only the signing user
can see the document, then I think you're looking at encrypting the entire
document. Especially if you intend to comply with any sort of industry
standards with respect to document signing.
If you wanted to support signing in a way that allowed non-signing users
to see the document, then an alternative would be to follow the PGP
model. Then the document could be assured of not having changed, without
having the whole thing encrypted.
In either case, this isn't something that's going to be supported in the
language. .NET provides cryptograpic classes in a specific namespace;
those might be useful in your implementation, but they are only going to
be tools. As far as I know, there's no magic bullet that you can use that
will just enable this sort of thing.
If it's okay for the document to be vulnerable except as stored in the
database, I suppose it's possible that you can use some sort of database
implementation that supports user-authenticated encryption (e.g. similar
to the encryption Windows includes on NTFS). I've never heard of that,
but then I don't really know that much about specific database
implementations. The fact that I've never heard of it has no bearing on
the likelihood of it existing.
Pete
Good question. I never did think about doing that - Just serialize the
object states into xml with the rest of it. I will have to consider
something like that. Guess figuring things out can be kind of hard when you
have a large project to get done.
I am trying to figure out the different ways of making an object
unchangeable. Guess the original question didn't really help with what I
needed though...
The object would be serialized into an XmlDocument object and then given to
the business/validation layer of the code. It would then get validated and
given to the data access flow and then dumped into the database. The reverse
(of course) would be for getting the object out of the database: Pull it out
of the database, give it to the business/validation layer, validated (and
whatever else needed to be done), convert the columns and its contents into
c# data types and then hand them off to the top layer code. Don't think this
has anything to do with your last section, but figured it was relevant.
I considered using some sort of encrypting format to prove signing, Any
ideas on what to use and how to use it? What do you mean if it is done in a
valid way? The signing or the encrypting? I am assuming that externalizing
the object means to make it available outside the intended environment it is
supposed to be used in (like an xml file for example)?
That's what I figured in the last section.
Oh, yea. Security issues are always fun. NOT! On the note of security, In
order to access the serialized objects that are inside the database, there
will have to be some userauthenticationin place. I have some ideas to try
and keep the security keys and stuff to a low minimum, but I'm pretty surea
pro hacker would be able to figure anything out. I might not be able to use
the ideas in full, but do you have any good security tips and stuff when it
comes toauthentication?
This is a series of web applications that will use the objects in question..
I have to write a document signing service for customers to be able to sign
the documents (objects) in question. This document signing service needs to
comply with the ELECTRONIC SIGNATURES IN GLOBAL AND NATIONAL COMMERCE ACT
(www.ftc.gov/os/2001/06/esign7.htm). Just invalidating the object, or
letting somebody be able to change the data behind the programs back can't
be allowed. For every one's sake, the objects (documents) have to be as
secured as possible. This means doing whatever possible to make sure that
once the document is signed, that it can't be changed in any way except for
setting state bits on it like paid in full or fulfilled in the case of a
contract. There would have to be userauthentication(like mentioned above)
where only the person that signed the document can see it. This is the very
basic plan. It is more complex than this - but for security reasons, I can't
say any more about the service design.
See above for project explanation to the best of my legal ability.
Good question. I never did think about doing that - Just serialize the
object states into xml with the rest of it. I will have to consider
something like that. Guess figuring things out can be kind of hard when
you
have a large project to get done.
I am trying to figure out the different ways of making an object
unchangeable. Guess the original question didn't really help with what I
needed though...
The object would be serialized into an XmlDocument object and then given
to
the business/validation layer of the code. It would then get validated and
given to the data access flow and then dumped into the database. The
reverse
(of course) would be for getting the object out of the database: Pull it
out
of the database, give it to the business/validation layer, validated (and
whatever else needed to be done), convert the columns and its contents
into
c# data types and then hand them off to the top layer code. Don't think
this
has anything to do with your last section, but figured it was relevant.
I considered using some sort of encrypting format to prove signing, Any
ideas on what to use and how to use it? What do you mean if it is done in
a
valid way? The signing or the encrypting? I am assuming that externalizing
the object means to make it available outside the intended environment it
is
supposed to be used in (like an xml file for example)?
That's what I figured in the last section.
Oh, yea. Security issues are always fun. NOT! On the note of security, In
order to access the serialized objects that are inside the database, there
will have to be some userauthenticationin place. I have some ideas to try
and keep the security keys and stuff to a low minimum, but I'm pretty sure
a
pro hacker would be able to figure anything out. I might not be able to
use
the ideas in full, but do you have any good security tips and stuff when
it
comes toauthentication?
This is a series of web applications that will use the objects in
question.
I have to write a document signing service for customers to be able to
sign
the documents (objects) in question. This document signing service needs
to
comply with the ELECTRONIC SIGNATURES IN GLOBAL AND NATIONAL COMMERCE ACT
(www.ftc.gov/os/2001/06/esign7.htm). Just invalidating the object, or
letting somebody be able to change the data behind the programs back can't
be allowed. For every one's sake, the objects (documents) have to be as
secured as possible. This means doing whatever possible to make sure that
once the document is signed, that it can't be changed in any way except
for
setting state bits on it like paid in full or fulfilled in the case of a
contract. There would have to be userauthentication(like mentioned above)
where only the person that signed the document can see it. This is the
very
basic plan. It is more complex than this - but for security reasons, I
can't
say any more about the service design.
See above for project explanation to the best of my legal ability.
The company and the customer are supposed to sign the document. When theYou're not specific about what effect this should have, or how you expect
the two to >interact.
Yes, both customer and company have to be able to view the document. ThereAre both people supposed to be able to access the document after it's been
signed?
No, this method is not possible. Disk space is expensive and the databaseCan you simply store two encrypted versions of the document?
Yes, that is entirely possible. The only restriction to this is that if theAlternatively, is it okay for the company to retain a copy of the
customer's encryption key?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.