[xmlsec] Special password length for block encryption?

Stefan Schulze Frielinghaus stefan at seekline.net
Fri Mar 21 06:48:50 PST 2008


Hello,

I'm just playing around with the XMLsec library and wanted to encrypt
one content of my XML file. I run into a problem when the length of the
password varies. For example for 3DES the password has to be 24
characters long. For AES256 it has to be 32 characters long.

If the password isn't the exact size I receive the following error
message (which made me headaches for hours because it's not really
meaningful, maybe space for improvement?):

func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=885:obj=unknown:subj=unknown:error=45:key is not found: 
func=xmlSecEncCtxXmlEncrypt:file=xmlenc.c:line=375:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:

I also skim through the XML Encryption Standard but couldn't find any
limitations so I suspect that I did something wrong or the library is
not functioning properly.

Any ideas?

Best regards
Stefan

PS: xmlsec version 1.2.11
PSS: The very skeleton of my application:
encDataNode = xmlSecTmplEncDataCreate(doc, xmlSecTransformAes256CbcId,
              NULL, xmlSecTypeEncContent, NULL, NULL);
xmlSecTmplEncDataEnsureCipherValue(encDataNode)
encCtx = xmlSecEncCtxCreate(NULL);
encCtx->encKey = xmlSecKeyReadMemory (xmlSecKeyDataAesId, password,
		strlen (password));
xmlSecEncCtxXmlEncrypt (encCtx, encDataNode, secnode)




More information about the xmlsec mailing list