canonicalization

Generating an XML document hash in C#

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 12:47:33
What's the best way to go about hashing an XML document in C#? I'd like to hash an XML document so that I can tell if it was manually changed from when it was generated. I'm not using this for security--it's OK if someone changes the XML, and changes the hash to match. For example, I'd hash the child nodes of the root and store the hash as an attribute of the root: <RootNode Hash="abc123"> <!-- Content to hash here --> </RootNode> .NET has classes that implement the XML digital signature spec . The signature can be added inside the original XML document (i.e. an "enveloped signature"), or

Which is the proper XML exclusive canonicalization?

天大地大妈咪最大 提交于 2019-12-02 08:00:45
问题 I'm using xmlseclibs to try and sign a SOAP document, but it does not seem to canonicalize things in the same way depending on whether I'm signing or validating. I'll give you an example. This is the XML I am trying to sign: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" MajorVersion="1" MinorVersion="1"

Which is the proper XML exclusive canonicalization?

这一生的挚爱 提交于 2019-12-02 07:18:57
I'm using xmlseclibs to try and sign a SOAP document, but it does not seem to canonicalize things in the same way depending on whether I'm signing or validating. I'll give you an example. This is the XML I am trying to sign: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" MajorVersion="1" MinorVersion="1" IssueInstant="2010-02-04T15:27:43Z" ResponseID="pfxe85313e6-e688-299a-df06-30f55e24f65a"> <samlp:Status> <samlp

Redirect URLs with FQDN (dot after TLD) to equivalent with PQDN

断了今生、忘了曾经 提交于 2019-12-02 01:09:40
问题 Many websites can be accessed with a FQDN (i.e., appending a dot to the TLD): https://www.ebay.com./ https://www.google.com./ https://www.reddit.com./ https://stackoverflow.com./ https://en.wikipedia.org./wiki/Main_Page Some sites can’t be accessed that way, but I can’t find an example right now.¹ ² Is it possible, within a .htaccess file, to redirect all variants with the dot suffix to the variants without? Ideally with a "wildcard" rule, so that you don’t have to list the domains explicitly

Redirect URLs with FQDN (dot after TLD) to equivalent with PQDN

眉间皱痕 提交于 2019-12-01 20:24:06
Many websites can be accessed with a FQDN (i.e., appending a dot to the TLD): https://www.ebay.com./ https://www.google.com./ https://www.reddit.com./ https://stackoverflow.com./ https://en.wikipedia.org./wiki/Main_Page Some sites can’t be accessed that way, but I can’t find an example right now.¹ ² Is it possible, within a .htaccess file, to redirect all variants with the dot suffix to the variants without? Ideally with a "wildcard" rule, so that you don’t have to list the domains explicitly (for using it on different sites/domains without editing). Example redirects: http://example.com./ →

What does Canonical Representation mean and its potential vulnerability to websites

时光毁灭记忆、已成空白 提交于 2019-12-01 15:54:00
I searched on google for a meaning of canonical representation and turned up documents that are entirely too cryptic. Can anyone provide a quick explanation of canonical representation and also what are some typical vulnerabilities in websites to canonical representation attacks? Canonicalisation is the process by which you take an input, such as a file name, or a string, and turn it into a standard representation. For example if your web application only allows access to files under C:\websites\mydomain then typically any input referring to filenames is canonicalised to be a physical, direct

What does Canonical Representation mean and its potential vulnerability to websites

余生颓废 提交于 2019-12-01 14:50:48
问题 I searched on google for a meaning of canonical representation and turned up documents that are entirely too cryptic. Can anyone provide a quick explanation of canonical representation and also what are some typical vulnerabilities in websites to canonical representation attacks? 回答1: Canonicalisation is the process by which you take an input, such as a file name, or a string, and turn it into a standard representation. For example if your web application only allows access to files under C:

Rejecting isomorphisms from collection of graphs

谁说胖子不能爱 提交于 2019-11-30 06:48:53
I have a collection of 15M (Million) DAGs (directed acyclic graphs - directed hypercubes actually) that I would like to remove isomorphisms from. What is the common algorithm for this? Each graph is fairly small, a hybercube of dimension N where N is 3 to 6 (for now) resulting in graphs of 64 nodes each for N=6 case. Using networkx and python, I implemented it like this which works for small sets like 300k (Thousand) just fine (runs in a few days time). def isIsomorphicDuplicate(hcL, hc): """checks if hc is an isomorphism of any of the hc's in hcL Returns True if hcL contains an isomorphism of

my ideal cache using guava

孤街醉人 提交于 2019-11-30 06:22:21
问题 Off and on for the past few weeks I've been trying to find my ideal cache implementation using guava's MapMaker. See my previous two questions here and here to follow my thought process. Taking what I've learned, my next attempt is going to ditch soft values in favor of maximumSize and expireAfterAccess: ConcurrentMap<String, MyObject> cache = new MapMaker() .maximumSize(MAXIMUM_SIZE) .expireAfterAccess(MINUTES_TO_EXPIRY, TimeUnit.MINUTES) .makeComputingMap(loadFunction); where Function

Rejecting isomorphisms from collection of graphs

ぃ、小莉子 提交于 2019-11-29 06:27:57
问题 I have a collection of 15M (Million) DAGs (directed acyclic graphs - directed hypercubes actually) that I would like to remove isomorphisms from. What is the common algorithm for this? Each graph is fairly small, a hybercube of dimension N where N is 3 to 6 (for now) resulting in graphs of 64 nodes each for N=6 case. Using networkx and python, I implemented it like this which works for small sets like 300k (Thousand) just fine (runs in a few days time). def isIsomorphicDuplicate(hcL, hc): ""