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 org.apache.axis.client.Call; | |
import org.apache.axis.client.Service; | |
import org.apache.axis.encoding.XMLType; | |
import javax.xml.rpc.ParameterMode; | |
public class CalculatorClient extends javax.swing.JFrame { | |
private String endPoint,operasi; | |
private Service service; | |
private double hasil, tmp; |
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
public class Hitung | |
{ | |
public double tambah(double a, double b) | |
{ | |
return a + b; | |
} | |
public double kurang(double a, double b) | |
{ | |
return a - b; | |
} |
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
<html> | |
<head> | |
<title>Enkripsi rsa</title> | |
</head> | |
<body> | |
<?php | |
ini_set("memory_limit","32M"); | |
include("generate.php"); | |
// FUNGSI ENKRIPSI |
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
<pre> | |
<?php | |
echo "<h2>Membuat public & private key RSA</h2>\n"; | |
//untuk membuat kunci yang lebih panjang coba gmp_random | |
//$rand1 = gmp_random(1); // mengeluarkan random number dari 0 sampai 1 x limb | |
//$rand2 = gmp_random(1); // mengeluarkan random number dari 0 sampai 1 x limb | |
//mencari bilangan random |
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
<?php | |
if(!empty($_POST['enkrip'])){ | |
$n=$_POST['n']; | |
$e=$_POST['e']; | |
$teks=$_POST['teks']; | |
//pesan dikodekan menjadi kode ascii, kemudian di enkripsi per karakter | |
for($i=0;$i<strlen($teks);++$i){ | |
//rumus enkripsi <enkripsi>=<pesan>^<e>mod<n> | |
$hasil.=gmp_strval(gmp_mod(gmp_pow(ord($teks[$i]),$e),$n)); | |
//antar tiap karakter dipisahkan dengan "." |
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
<?php | |
if(!empty($_POST['dekrip'])){ | |
$time_start = microtime(true);//menghitung waktu awal eksekusi | |
$n=$_POST['n']; | |
$d=$_POST['d']; | |
//pesan enkripsi dipecah menjadi array dengan batasan "." | |
$teks=explode(".",$_POST['teks']); | |
foreach($teks as $nilai){ | |
//rumus enkripsi <pesan>=<enkripsi>^<d>mod<n> | |
$hasil.=chr(gmp_strval(gmp_mod(gmp_pow($nilai,$d),$n))); |
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
''' | |
SimpleSecureHTTPServer.py - simple HTTP server supporting SSL. | |
- replace fpem with the location of your .pem server file. | |
- the default port is 443. | |
usage: python SimpleSecureHTTPServer.py | |
Credit: https://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/ | |
License: PSF License |
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
<?php | |
for ($i = 'a'; $i <= 'z'; $i++) | |
echo "$i\n"; |
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
program pencacah; | |
uses crt; | |
var | |
input : longint; | |
function ubah(n : integer; singkat:boolean):string; | |
var | |
hasil:string; | |
ratus,puluh,level,tmp:integer; | |
selesai:boolean; |
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
###################################################### | |
# namafile : webserver.py | |
# implementasi HTTP web server di python dengan fitur tambahan untuk | |
# menjalankan server-side CGI script; menyediakan file-file/script dari | |
# 'current working dir'; Python script harus diletakkan di webdir/cgi-bin | |
###################################################### | |
webdir = '.' # Tempat html file berada dan cgi-bin directory | |
port = 8080 # default http://localhost/, atau menggunakan http://localhost:xxxx/ | |
import os, sys | |
from BaseHTTPServer import HTTPServer |
OlderNewer