{"record":{"id":"30cd36dfb207d5ff","repo":"pentaho/pentaho-kettle","slug":"symmetriccrypto-symmetriccrypto-error-cipher","errorCode":"SymmetricCrypto.SymmetricCrypto.Error.Cipher","errorMessage":"SymmetricCrypto.SymmetricCrypto.Error.Cipher","messagePattern":"SymmetricCrypto\\.SymmetricCrypto\\.Error\\.Cipher","errorType":"exception","errorClass":"CryptoException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/symmetriccrypto/symmetricalgorithm/SymmetricCrypto.java","lineNumber":82,"sourceCode":"    }\n  }\n\n  /**\n   * Construct a new Symetric SymmetricCrypto trans\n   *\n   * @param inf\n   *          The Database Connection Info to construct the connection with.\n   */\n  public SymmetricCrypto( SymmetricCryptoMeta meta, String xform ) throws CryptoException {\n    this.meta = meta;\n    this.scheme = Const.NVL( xform, meta.getDefaultScheme() );\n    try {\n      if ( this.scheme == null ) {\n        throw new CryptoException( BaseMessages.getString( PKG, \"SymmetricCrypto.SchemeMissing\" ) );\n      }\n      this.cipher = Cipher.getInstance( this.scheme );\n    } catch ( Exception e ) {\n      throw new CryptoException( BaseMessages.getString( PKG, \"SymmetricCrypto.SymmetricCrypto.Error.Cipher\", e ) );\n    }\n  }\n\n  public void setEncryptMode() throws CryptoException {\n    try {\n      this.cipher.init( Cipher.ENCRYPT_MODE, this.secretKeySpec );\n    } catch ( Exception e ) {\n      throw new CryptoException( e );\n    }\n  }\n\n  public void setDecryptMode() throws CryptoException {\n    try {\n      this.cipher.init( Cipher.DECRYPT_MODE, this.secretKeySpec );\n    } catch ( Exception e ) {\n      throw new CryptoException( e );\n    }\n  }","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/symmetriccrypto/symmetricalgorithm/SymmetricCrypto.java#L64-L100","documentation":"In the two-argument SymmetricCrypto constructor, CryptoException 'SymmetricCrypto.SymmetricCrypto.Error.Cipher' wraps any exception thrown by Cipher.getInstance(scheme) — most commonly NoSuchAlgorithmException/NoSuchProviderException because the requested transformation is not available from installed JCE providers.","triggerScenarios":"Cipher.getInstance(scheme) throwing NoSuchAlgorithmException for a scheme name typo or unsupported combination (e.g. 'AES/GCM/NoPadding' on old JDKs), or an unlimited-strength policy missing for strong keys on very old JDKs.","commonSituations":"Scheme string misspelled or wrong case/spacing ('AES/CBC/PKCS5Padding' variants); algorithm not registered in java.security config; running on an old JDK (<8u161) without unlimited strength JCE policy files; third-party provider (BouncyCastle) not registered.","solutions":["Fix the scheme string to an exact JCE transformation, e.g. \"AES\" or \"AES/CBC/PKCS5Padding\"","Register BouncyCastle if the scheme needs it: Security.addProvider(new BouncyCastleProvider())","On legacy JDKs, install the unlimited strength JCE policy files (or upgrade to JDK 8u161+)","Print available algorithms: iterate Security.getProviders() and their services to confirm support"],"exampleFix":"// before\nSymmetricCrypto c = new SymmetricCrypto(meta, \"AES/ANY/Pad\"); // invalid transformation\n// after\nSymmetricCrypto c = new SymmetricCrypto(meta, \"AES/CBC/PKCS5Padding\");","handlingStrategy":"try-catch","validationCode":"// probe JCE support before constructing\ntry {\n  javax.crypto.Cipher.getInstance(scheme);\n} catch (javax.crypto.NoSuchPaddingException | java.security.NoSuchAlgorithmException e) {\n  throw new IllegalArgumentException(\"Scheme not supported: \" + scheme, e);\n}","typeGuard":null,"tryCatchPattern":"try { crypto = new SymmetricCrypto(meta, scheme); } catch (CryptoException e) { log.error(\"Cipher unavailable for \" + scheme + \": \" + e.getMessage(), e); }","preventionTips":["Use exact JCE transformation names","Register BouncyCastle for non-baseline algorithms","On old JDKs install unlimited strength JCE policy files"],"tags":["crypto","jce","cipher","unsupported-algorithm"],"backgroundTag":"unsupported-operation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}