This file contains hidden or 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
import dgram from 'dgram'; | |
import radius from 'radius'; | |
const server = dgram.createSocket('udp4'); | |
const RADIUS_SECRET = 'HOGEHOGE'; // RADIUSの共有シークレット | |
function auth(mac: string): boolean { | |
return mac === '00:00:00:00:00:00'; // 認証したいMACアドレス | |
} |
This file contains hidden or 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
/* | |
このコードはKotlinでPEM形式のRSAおよびEC公開鍵暗号を利用したサンプルプログラムです。 | |
**警告**: 文字列になっている公開暗号鍵ペアは絶対にそのまま使用しないこと。 | |
opensslコマンドを打って必ず自分で生成してください。 | |
実行結果: | |
[RSA/ECB/PKCS1Padding] matched: true, original: Hello world!, decrypted: Hello world! | |
[SHA256withRSA] valid: true, original: Hello world! | |
[SHA256withECDSA] valid: true, original: Hello world! |
OlderNewer