# Kullanım

{% tabs %}
{% tab title="Metin" %}

```csharp
//SecureBase.SBEncoding sbencoding = SecureBase.SBEncoding.UNICODE;
SecureBase.SBEncoding sbencoding = SecureBase.SBEncoding.UTF8;

SecureBase bs = new SecureBase(sbencoding);
bs.SetSecretKey(secretkey);

//Encoding
string encodeddata = bs.Encode(data);

//Decoding
string decodeddata = bs.Decode(data);
```

{% endtab %}

{% tab title="Dosya" %}

```java
SecureBase sb = new SecureBase(SecureBase.SBEncoding.UTF8);
sb.SetSecretKey("xcompany-secret-key");

byte[] filedatabytes = Files.readAllBytes(Paths.get("data.txt"));
String filedata = new String(filedatabytes, StandardCharsets.UTF_8);

//Encoding
String encodeddata = sb.encode(filedata);
Files.write(Paths.get("encoded.txt"), encodeddata.getBytes(StandardCharsets.UTF_8));

//Decoding
String decodeddata = sb.decode(encodeddata);
Files.write(Paths.get("decoded.txt"), decodeddata.getBytes(StandardCharsets.UTF_8));
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
[**Github**](https://github.com/beytullahakyuz/securebase-java)'ta bulunan [SecureBaseApp](https://github.com/beytullahakyuz/securebase-java/tree/main/demos/SecureBaseApp) uygulaması üzerinden örnek kullanımları inceleyebilirsiniz.
{% endhint %}

***
