def caesar_encrypt(text, shift):
result = ""
for char in text:
if char.isalpha():
shift_base = 65 if char.isupper() else 97
result += chr((ord(char) - shift_base + shift) % 26 + shift_base)
else:
result += char
return result
text = "Praktikum Keamanan Komputer"
shift = 3
print("Hasil Enkripsi Caesar Cipher:", caesar_encrypt(text, shift))
ZGVmIGNhZXNhcl9lbmNyeXB0KHRleHQsIHNoaWZ0KToKICAgIHJlc3VsdCA9ICIiCiAgICBmb3IgY2hhciBpbiB0ZXh0OgogICAgICAgIGlmIGNoYXIuaXNhbHBoYSgpOgogICAgICAgICAgICBzaGlmdF9iYXNlID0gNjUgaWYgY2hhci5pc3VwcGVyKCkgZWxzZSA5NwogICAgICAgICAgICByZXN1bHQgKz0gY2hyKChvcmQoY2hhcikgLSBzaGlmdF9iYXNlICsgc2hpZnQpICUgMjYgKyBzaGlmdF9iYXNlKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHJlc3VsdCArPSBjaGFyCiAgICByZXR1cm4gcmVzdWx0Cgp0ZXh0ID0gIlByYWt0aWt1bSBLZWFtYW5hbiBLb21wdXRlciIKc2hpZnQgPSAzCnByaW50KCJIYXNpbCBFbmtyaXBzaSBDYWVzYXIgQ2lwaGVyOiIsIGNhZXNhcl9lbmNyeXB0KHRleHQsIHNoaWZ0KSk=