You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "jacopoc (via GitHub)" <gi...@apache.org> on 2026/09/30 15:13:49 UTC
[PR] Implemented: Remove outdated DesCrypt implementation [ofbiz-framework]
jacopoc opened a new pull request, #2167:
URL: https://github.com/apache/ofbiz-framework/pull/2167
Remove the obsolete DesCrypt class and all references to it, as it relied on outdated and potentially insecure cryptographic algorithms.
The removed code had already stopped working. The IV change for OFBIZ-12281 (9963c46c82/4e0ed1e6df, July 2021) broke DesCrypt, and every 24.09.x release shipped it that way:
- encrypt() could never succeed. It called System.arraycopy(iv, …) and System.arraycopy(cipher, …) with an IvParameterSpec and a Cipher as source arguments. Those aren't arrays, so it always threw ArrayStoreException.
- decrypt() could never give the right plaintext. It:
- Base64-decoded input its callers had already hex- or Base64-decoded.
- Built the cipher with Cipher.ENCRYPT_MODE instead of decrypt mode.
- Ran doFinal(bytes) on the whole original input instead of the ciphertext after the IV.
So on trunk and 24.09.x, the legacy fallback in EntityCrypto.decrypt() (the funny-hash, normal-hash and salted-base64 handlers) always failed silently. The DES fallback in the key re-encryption service (EntityDataServices) also always failed. Nobody on those versions can have data that only DesCrypt could read.
**Note for 18.12.x deployments with very old data.**
18.12.x still has the working DesCrypt without the IV change. Since 2015 (eb6d01b066), new encryption has always used the Shiro/AES handler. The DES handlers only mattered for decrypting values and EntityKeyStore keys created by OFBiz releases from before 2015 and never re-encrypted since. Those deployments already had to migrate that data when they move to 24.09, so these changes don't make things worse. The practical fix is to re-save the affected records on 18.12 before upgrading, which re-encrypts them with AES.
Thus, deployments upgrading from 18.12 or earlier that still hold field values or EntityKeyStore keys encrypted before Shiro/AES was introduced (2015) must re-encrypt that data on the old release (e.g. by re-saving the affected records) before upgrading.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Implemented: Remove outdated DesCrypt implementation [ofbiz-framework]
Posted by "jacopoc (via GitHub)" <gi...@apache.org>.
jacopoc merged PR #2167:
URL: https://github.com/apache/ofbiz-framework/pull/2167
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Implemented: Remove outdated DesCrypt implementation [ofbiz-framework]
Posted by "mridulpathak (via GitHub)" <gi...@apache.org>.
mridulpathak commented on PR #2167:
URL: https://github.com/apache/ofbiz-framework/pull/2167#issuecomment-5927932807
Hi @jacopoc ,
The changes look good to me. One thing I noticed about the 18.12 note: it seems the IV change from OFBIZ-12281 was also committed to release18.12 (bbc2d23f3a and ace168d329), so DesCrypt might be broken there too.
Also, after the removal of OLD_FUNNY_HASH_STORAGE_HANDLER and SaltedBase64StorageHandler, HashCrypt.digestHashOldFunnyHex, HashCrypt.getDigestHashOldFunnyHexEncode (deprecated) and HashCrypt.digestHash64 have no callers left. They could be removed here or in a follow-up.
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org