{"record":{"id":"1ec5f4cda66d723e","repo":"GoogleContainerTools/jib","slug":"sha-256-algorithm-implementation-not-found-might","errorCode":null,"errorMessage":"SHA-256 algorithm implementation not found - might be a broken JVM","messagePattern":"SHA-256 algorithm implementation not found - might be a broken JVM","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"jib-cli/src/main/java/com/google/cloud/tools/jib/cli/CacheDirectories.java","lineNumber":81,"sourceCode":"  @VisibleForTesting\n  static String getProjectCacheDirectoryFromProject(Path path) {\n    try {\n      byte[] hashedBytes =\n          MessageDigest.getInstance(\"SHA-256\")\n              .digest(path.toFile().getCanonicalPath().getBytes(Charsets.UTF_8));\n      StringBuilder stringBuilder = new StringBuilder(2 * hashedBytes.length);\n      for (byte b : hashedBytes) {\n        stringBuilder.append(String.format(\"%02x\", b));\n      }\n      return stringBuilder.toString();\n    } catch (IOException | SecurityException ex) {\n      throw new RuntimeException(\n          \"Unable to create cache directory for project path: \"\n              + path\n              + \" - you can try to configure --project-cache manually\",\n          ex);\n    } catch (NoSuchAlgorithmException ex) {\n      throw new RuntimeException(\n          \"SHA-256 algorithm implementation not found - might be a broken JVM\");\n    }\n  }\n\n  public CacheDirectories(@Nullable Path baseImageCache, Path projectCache) {\n    this.baseImageCache = baseImageCache;\n    this.projectCache = projectCache;\n  }\n\n  public Optional<Path> getBaseImageCache() {\n    return Optional.ofNullable(baseImageCache);\n  }\n\n  public Path getProjectCache() {\n    return projectCache;\n  }\n\n  public Path getApplicationLayersCache() {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-cli/src/main/java/com/google/cloud/tools/jib/cli/CacheDirectories.java#L63-L99","documentation":"When hashing the project path, Jib requests the SHA-256 MessageDigest from the JVM. If MessageDigest.getInstance(\"SHA-256\") throws NoSuchAlgorithmException, the CLI throws this RuntimeException, indicating the JVM's security provider set is broken or missing SHA-256.","triggerScenarios":"getProjectCacheDirectoryFromProject (via from) calling MessageDigest.getInstance(\"SHA-256\") on a JVM whose providers do not include SHA-256 (custom JRE built with jlink stripped of crypto providers, or a provider-removal misconfiguration).","commonSituations":"Custom jlink-minimized runtimes lacking jdk.crypto modules, exotic/trimmed JVM distributions, security provider overridden in java.security config.","solutions":["Run Jib CLI with a standard JDK/JRE that includes the default SUN security provider.","If using jlink, include jdk.crypto.ec/jdk.crypto.cryptoki modules in the custom runtime.","Check java.security configuration for removed security providers and restore the default set."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"try {\n  java.security.MessageDigest.getInstance(\"SHA-256\");\n} catch (java.security.NoSuchAlgorithmException e) {\n  throw new IllegalStateException(\"JVM lacks SHA-256; use a standard JDK\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a standard JDK/JRE distribution for Jib CLI","If using jlink, include jdk.crypto.* modules","Avoid removing default security providers in java.security"],"tags":["jvm","crypto","environment"],"backgroundTag":"unsupported-platform","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}