cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How encryptStringWithKey works

iguerra
14-Alexandrite

How encryptStringWithKey works

Can someone tell me which method encryptStringWithKey uses to encrypt data ?

I need to encrypt from thingworx but decrypt the string from an external system so I need to do the decrypt in the same way, using the same key

I just read from online help it should use AES/CBC/PKCS5Padding, but seems key length is not the right ...

the function needs 56 hex characters to encrypt, so it should be 28 bytes (224 bit) ...

Thanks

2 REPLIES 2

I had this once checked with R&D and the official answer was what's documented in https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS216822

The EncryptionServices are used for symmetric encryption and

  • The involved algorithm is based on SunJCE with AES/CBC/PKCS5Padding and 128 bit
  • The key size must be specified in 56 bytes via a hex string (0-f)
  • The initialization vector (IV) will always be the first 16 bytes of the key specified for encryption / decryption

I had brought up those concerns as well but there wasn't any more detailed information on how the services are supposed to work

iguerra
14-Alexandrite
(To:mneumann)

Is there an online service to check encryption that gives the same result of encryptStringWithKey ?

I tried many but never had same result, or it gives an error on key length ...

Top Tags