A.Menezes, P. Van Oorschot, & S. Vanstone. 1996. Handbook of Applied Cryptography. USA : CRC Press, Inc.
Ariyus, D. 2008. Pengantar Ilmu Kriptografi: Teori , Analisis dan Implementasi. Andi Offeset: Yogyakarta.
Nataliana,Decy,Iqbal Syamsu,Galih Giantara.2014.NO 1 Vol 2.Sistem Monitoring Parkir Mobil menggunakan Sensor Infrared Berbais Raspberry Pi:Bandung.
Santoso,Berkah.2013.Bahasa Pemrograman Python Di Platform Gnu/Linux:
Tangerang.
Schneier, B. 1996. Applied Cryptography: Protocols, algorithms and source code in C. 2nd Edition. John Wiley & Sons, Inc.: New Jersey
Seagrave, W. 2013. Basic4Android : Rapid app development for Android. Penny Press: United Kingdom
Sinulingga, Rio Dat Permana. 2017.Penggunaan Mikrokontroler Arduino Due berbasis Android dengan Algoritma IDEA untuk Sistem Keamanan Sepeda Motor. Universitas Sumatera Utara. Medan.
Smart, N. 2004. Cryptography: An introduction. 3rd Edition. University of Bristol.
Verma, N., Gupta, K. & Mahapatra, S. 2015. Implementation of solid state relays for power system protection. International Journal of Scientific & Technology Research(IJSTR) 4(6) : 65 – 70.
Wardani, dkk. 2011. Implementasi Metode Kriptografi Idea Pada Priority Dealer Untuk Layanan Pemesanan dan Laporan Penjualan Handphone Berbasis Web.
Jurnal Skripsi. ITS. Surabaya.
Yoga, Agung Putu. 2016. Implementasi Algoritma One Time Pad pada Mikrokontroler Atmega32 untuk Keamanan Password Sistem Kendali Pintu Berbasis Android.
Universitas Sumatera Utara. Medan.
Listing Program
1. Sakelar.py (Raspberry Pi) import json
GPIO.setmode(GPIO.BCM) # set board mode to Broadcom GPIO.setup(sakelar, GPIO.OUT)
GPIO.setup(starter, GPIO.OUT) GPIO.setup(starter, GPIO.OUT)
GPIO.setup(PIN_POWER, GPIO.OUT,initial=0)
#GPIO.setup(PIN_RESET, GPIO.OUT,initial=1) GPIO.output(sakelar , mati)
GPIO.output(starter, mati) def on_off():
GPIO.output(PIN_POWER,1) time.sleep(5)
GPIO.output(PIN_POWER,0)
#def reset():
# GPIO.output(PIN_RESET,0) #time.sleep(5)
#GPIO.output(PIN_RESET,1) try:
on_off()
subprocess.Popen(['python sms.py'], shell=True) while True:
print "e"
#python = sys.executable
#os.execl(python, python, * sys.argv) 2. Sensor.py (Raspberry Pi)
import RPi.GPIO as GPIO
with open("sakelar.json","r+") as jsonFiles:
jsonDatas = json.load(jsonFiles)
print "Sensor-restart"
python = sys.executable time.sleep(2)
os.execl(python, python, * sys.argv) 3. Sensor.py (Raspberry Pi)
import time
import os
GSM.write("AT+CMGF=1\r") time.sleep(3)
GSM.write('AT+CMGDA="DEL ALL"\r') time.sleep(3)
print "dihapus"
def baca_sms():
GSM.write("AT+CMGF=1\r") time.sleep(3)
GSM.write("AT+CMGR=1\r") time.sleep(3)
print "SMS diterima. Konten:"
def kirim_sms(pesan):
GSM.write("AT+CMGF=1\r")
GSM.write('''AT+CMGS="''' + nomorhp + '''"\r''')
GSM.write("AT+CGNSPWR=1\r") GSM.write("AT+CGNSTST=1\r") time.sleep(2)
def lokasiOff():
GSM.write("AT+CGNSPWR=0\r") time.sleep(5)
delete_sms() while True:
with open("alarm.json","r+") as jsonFile:
jsonDataAlarm = json.load(jsonFile)
jsonFile.write(json.dumps(jsonDataAlarm,indent=4))
data_Enc=split_by_length(sms_masuk,len(sms_masuk)/2) chiper=data_Enc[0]
delete_sms()
chiperTextArray=list(chiperText) keyArray=list(Key)
chiperTextByteArray=[]
keyByteArray=[]
#kunci ke byte
for i in range(len(keyArray)):
keyByteArray.append(char_to_byte(keyArray[i])) #Dekripsi
for i in range(len(chiperTextArray)):
chiperTextByteArray.append(char_to_byte(chiperTextArray[i])) x=(chiperTextByteArray[i]-keyByteArray[i]) % len(tabelChar) plainText.append(byte_to_char(x))
hasil=''.join(plainText)
#x="}sL-s1"
parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS) bt=True
init=""
print "connected"
with open("sakelar.json","r+") as jsonFileinit:
jsonDatainit= json.load(jsonFileinit)
if plain=="SA1":
public abstract class BaseActivity extends AppCompatActivity implements
BottomNavigationView.OnNavigationItemSelectedListener { protected BottomNavigationView navigationView;
@Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(getContentViewId());
navigationView = findViewById(R.id.navigation);
navigationView.setOnNavigationItemSelectedListener(this);
if (getIntent().getExtras() != null) {
super.onStart();
updateNavigationBarState();
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) { navigationView.postDelayed(() -> {
private void updateNavigationBarState(){
int actionId = getNavigationMenuItemId();
selectBottomNavigationBarItem(actionId);
}
void selectBottomNavigationBarItem(int itemId) { Menu menu = navigationView.getMenu();
abstract int getContentViewId();
protected abstract int getNavigationMenuItemId();
public void showMessage(String message) {
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
}
public void setNohp(String data){
this.nohp=data;
public class KontrolActivity extends BaseActivity {
private static final String TAG = "BluetoothService";
TextView textView;
ConnectedThread mConnectedThread;
BluetoothAdapter mBluetoothAdapter;
BluetoothDevice mDevice;
private BluetoothSocket mmSocket;
Handler mHandler;
ToggleButton buttonSakelar, buttonBluetooth;
Button buttonStarter;
@SuppressLint({"ClickableViewAccessibility", "HandlerLeak"}) @Override
public void onCreate(Bundle bundle) { super.onCreate(bundle);
buttonSakelar= findViewById(R.id.buttonSakelar);
buttonStarter= findViewById(R.id.buttonStarter);
buttonBluetooth=findViewById(R.id.buttonBluetooth);
textView=findViewById(R.id.judul);
buttonStarter.setEnabled(false);
OneTimePad oneTimePad=new OneTimePad();
buttonSakelar.setOnCheckedChangeListener((buttonView, isChecked) -> {
buttonBluetooth.setOnCheckedChangeListener((buttonView, isChecked) -> {
};
}
public void cekKetersediaan(){
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter == null) {
public void konekBluetooth(){
ConnectThread mConnectThread = new ConnectThread(mDevice);
mConnectThread.start();
}
private class ConnectThread extends Thread {
private UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
cancel();
private class ConnectedThread extends Thread { private final InputStream mmInStream;
private final OutputStream mmOutStream;
ConnectedThread(BluetoothSocket socket) { InputStream tmpIn=null;
//converts entered String into bytes try {
mmOutStream.write(msgBuffer);
//write bytes over BT connection via outstream } catch (IOException ignored) {
public void cancel() {
public void kirimData(String data){
try {
protected int getNavigationMenuItemId() { return R.id.navigation_kontrol;
* Created by Setiadi Prayogo on 3/29/2018.
*/
public class LocationAddress {
private static final String TAG = "LocationAddress";
public static void getAddressFromLocation(final double latitude, final double longitude,
try {
Longitude: " + longitude +
"\n Unable to get address for this
import java.text.SimpleDateFormat;
public class MapsActivity extends BaseActivity implements OnMapReadyCallback {
private MapView mapView;
private GoogleMap mMap;
TextView textViewAlamat,tV;
String NOHP="+6282167899377";
Double latitude=0.0,longitude= 0.0;
String tag_lokasi;
private static final String MAP_VIEW_BUNDLE_KEY =
"MapViewBundleKey";
@Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
textViewAlamat=findViewById(R.id.alamat);
tV=findViewById(R.id.title);
public void bacaSms(String pilihan){
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
"+smsKewaktu(waktu) +" : "+ isi+"\n";
waktuLokasi=smsKewaktu(waktu);
}
tV.setText("Waktu Lokasi Mobil: "+waktuLokasi);
}
public String smsKewaktu(String date){
Long timestamp = Long.parseLong(date);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(timestamp);
Date finaldate = calendar.getTime();
@SuppressLint("SimpleDateFormat") SimpleDateFormat formatter
= new SimpleDateFormat("yyyy/MM/dd|HH:mm");
String smsDate = formatter.format(finaldate);
return smsDate;
}
@Override
public void onPointerCaptureChanged(boolean hasCapture) { }
private class GeocoderHandler extends Handler { @Override
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState);
Bundle mapViewBundle =
outState.getBundle(MAP_VIEW_BUNDLE_KEY);
if (mapViewBundle == null) { mapViewBundle = new Bundle();
outState.putBundle(MAP_VIEW_BUNDLE_KEY, mapViewBundle);
}
mapView.onSaveInstanceState(mapViewBundle);
public void onMapReady(GoogleMap googleMap) { mMap = googleMap;
mMap.getUiSettings().setMapToolbarEnabled(true);
float zoomLevel = 16.0f;
LocationAddress locationAddress = new LocationAddress();
locationAddress.getAddressFromLocation(latitude, longitude, getApplicationContext(), new GeocoderHandler());
}
int getContentViewId() {
return R.layout.activity_maps;
}
@Override
protected int getNavigationMenuItemId() { return R.id.navigation_maps;
private int panjangTabel=tabelKarakter.length;
private int charToByte(char kar){
int hasil = 0;
private char byteToChar(int nilaibyte){
char hasil = 'x';
public String encript(String plainText){
char[] plainTextArray= plainText.toCharArray();
int[] plainTextByteArray = new int[plainTextArray.length];
int[] chiperByteArray = new int[plainTextArray.length];
StringBuilder chiperText= new StringBuilder();
StringBuilder keyText= new StringBuilder();
Random rand = new Random();
chiperText.append(byteToChar(chiperByteArray[i]));
}
Log.d("PlainText", plainText);
Log.d("Key", keyText.toString());
Log.d("ChiperText", chiperText.toString());
String
pesan="#"+chiperText.toString()+keyText.toString()+"#";
return pesan;
}
public String decript(String chiperText,String key){
char[] chiperTextArray= chiperText.toCharArray();
char[] keyArray= key.toCharArray();
int[] chiperTextByteArray = new int[chiperTextArray.length];
StringBuilder plainText= new StringBuilder();
for(int i=0;i<chiperTextArray.length;i++){
chiperTextByteArray[i]= charToByte(chiperTextArray[i]);
int y = (chiperTextByteArray[i]-keyByteArray[i]);
Log.d("PlainText", plainText.toString());
String pesan=plainText.toString();
import Android.widget.Button;
public class SmsActivity extends BaseActivity { Button buttonSakelar, buttonLokasi,buttonSave;
EditText editTextNohp;
public void onCreate(Bundle bundle) { super.onCreate(bundle);
buttonSakelar = findViewById(R.id.buttonSakelar);
buttonLokasi = findViewById(R.id.buttonLokasi);
buttonSave=findViewById(R.id.buttonSave);
textView=findViewById(R.id.judul);
editTextNohp=findViewById(R.id.editTextNohp);
bacaFile();
OneTimePad oneTimePad=new OneTimePad();
buttonSakelar.setOnClickListener(v ->{
String pesan=oneTimePad.encript("SAKELAR");
sendSMS(pesan);
showMessage("Sakelar mobil akan dimatikan.");
});
buttonSave.setOnClickListener(v -> {
dataJson.setNohp(editTextNohp.getText().toString());
String json = gson.toJson(dataJson);
tulisFile(json);
showMessage("Nomor kartu SIM Sistem Keamanan Mobil Diperbaharui.");
});
buttonLokasi.setOnClickListener(v -> {
FileInputStream fis=openFileInput("konfig.json");
ObjectInputStream is=new ObjectInputStream(fis);
public void tulisFile(String json){
try {
public void sendSMS(String data){
SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(editTextNohp.getText().toString(), null, data, null, null);
return R.id.navigation_sms;
} }