private void ObscuredStringExample()
        {
            /* -------------- usage example -------------- */

            // you can change default crypto key using this method
            // it will be automatically used by any new ObscuredString
            // instances and it will be applied to any existing instance
            // on the value change
            ObscuredString.SetNewCryptoKey("I LOVE MY GIRLz");

            // hey, Daniele! ;D
            var regular = "the Goscurry is not a lie ;)";

            // obscured <-> regular conversion is implicit
            ObscuredString obscured = regular;

            // you can get raw encrypted value at any time
            // and save it somewhere for example
            var encryptedValueRaw = obscured.GetEncrypted();

            // to construct new obscured instance from it after loading it back
            var newObscured = ObscuredString.FromEncrypted(encryptedValueRaw);

            // all other obscured types have similar usage pipeline and APIs

            /* -------------- logs-------------- */

            logBuilder.Length = 0;
            logBuilder.AppendLine("[ ObscuredString example ]");
            logBuilder.AppendLine("Original value:\n" + regular);
            logBuilder.AppendLine("Obscured value in memory:\n" + newObscured.GetEncrypted());
            Debug.Log(logBuilder);
        }
 private void Start()
 {
     Debug.Log("===== ObscuredStringTest =====\n");
     ObscuredString.SetNewCryptoKey("I LOVE MY GIRL");
     cleanString = "Try Goscurry! Or better buy it!";
     Debug.Log("Original string:\n" + cleanString);
     obscuredString = cleanString;
     Debug.Log("How your string is stored in memory when obscured:\n" + obscuredString.GetEncrypted());
     obscuredString = (cleanString = string.Empty);
 }
示例#3
0
        private void ObscuredStringExample()
        {
            this.logBuilder.Length = 0;
            this.logBuilder.AppendLine("[ACTk] <b>[ ObscuredString test ]</b>");
            ObscuredString.SetNewCryptoKey("I LOVE MY GIRLz");
            string text = "the Goscurry is not a lie ;)";

            this.logBuilder.AppendLine("Original string:\n" + text);
            ObscuredString obscuredString = text;

            this.logBuilder.AppendLine("How your string is stored in memory when obscured:\n" + obscuredString.GetEncrypted());
            Debug.Log(this.logBuilder);
        }
    private void Start()
    {
        Debug.Log("===== ObscuredStringTest =====\n");

        // example of custom crypto key using
        // this is not necessary! default key is "4441"
        ObscuredString.SetNewCryptoKey("I LOVE MY GIRL");

        // just a small self-test here (hey, Daniele! :D)
        cleanString = "Try Goscurry! Or better buy it!";
        Debug.Log("Original string:\n" + cleanString);

        obscuredString = cleanString;
        Debug.Log("How your string is stored in memory when obscured:\n" + obscuredString.GetEncrypted());

        obscuredString = cleanString = "";
    }
示例#5
0
        private void ObscuredStringExample()
        {
            logBuilder.Length = 0;
            logBuilder.AppendLine(Constants.LOG_PREFIX + "<b>[ ObscuredString test ]</b>");

            // example of custom crypto key using
            ObscuredString.SetNewCryptoKey("I LOVE MY GIRLz");

            // just a small self-test here (hey, Daniele! :D)
            string regular = "the Goscurry is not a lie ;)";

            logBuilder.AppendLine("Original string:\n" + regular);

            ObscuredString obscured = regular;

            logBuilder.AppendLine("How your string is stored in memory when obscured:\n" + obscured.GetEncrypted());

            Debug.Log(logBuilder);
        }