-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/usr/lib/jvm/default-jdk/bin/jjs | ||
#!/usr/bin/env graaljs | ||
|
||
var Base64 = Packages.java.util.Base64 | ||
var Cipher = Packages.javax.crypto.Cipher | ||
var SecretKeySpec = Packages.javax.crypto.spec.SecretKeySpec | ||
|
||
var key = arguments[0] | ||
var secret = Base64.getDecoder().decode(arguments[1]) | ||
var key = process.argv[2] | ||
var secret = Base64.getDecoder().decode(process.argv[3]) | ||
|
||
var cipher = Cipher.getInstance("AES") | ||
var keySpec = new SecretKeySpec(key.getBytes(), "AES") | ||
cipher.init(Cipher.DECRYPT_MODE, keySpec) | ||
var result = new java.lang.String(cipher.doFinal(secret)) | ||
echo(result) | ||
console.log(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/usr/lib/jvm/default-jdk/bin/jjs | ||
#!/usr/bin/env graaljs | ||
|
||
var Base64 = Packages.java.util.Base64 | ||
var Cipher = Packages.javax.crypto.Cipher | ||
var SecretKeySpec = Packages.javax.crypto.spec.SecretKeySpec | ||
|
||
var key = arguments[0] | ||
var text = arguments[1].getBytes() | ||
var key = process.argv[2] | ||
var text = process.argv[3].getBytes() | ||
|
||
var cipher = Cipher.getInstance("AES") | ||
var keySpec = new SecretKeySpec(key.getBytes(), "AES") | ||
cipher.init(Cipher.ENCRYPT_MODE, keySpec) | ||
var result = Base64.getEncoder().encodeToString(cipher.doFinal(text)) | ||
echo(result) | ||
console.log(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
$JAVA_HOME/bin/node --jvm $@ | ||
$JAVA_HOME/languages/js/bin/node --jvm --experimental-options --js.nashorn-compat=true $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
URxvt.background: #111 | ||
URxvt.font: xft:BPMono:size=9 | ||
URxvt.font: xft:CourierPrimeCode:size=11 | ||
URxvt.foreground: #ddd | ||
URxvt.geometry: 80x30 | ||
URxvt.scrollBar: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters