public static void SolveChallenge_ShouldSolveChallengeInputs() { string input = "1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736"; string expected = "Cooking MC's like a pound of bacon"; string actual = new Challenge3(new VigenereCrack(), input).SolveChallenge(); Assert.Equal(expected, actual); }
public void GetBestGuessSingleByteXorKey_Challenge5Data_CorrectKey() { int keyLength = 3; var hexModulo = keyLength * 2; var someKey = Challenge5Data.EncryptedHexValue .Select((c, i) => new { ByteNumber = (i % hexModulo) / 2, c }) .GroupBy(c => c.ByteNumber) .Select( g => Challenge3.GetBestGuessSingleByteXorKey(new string(g.Select(x => x.c).ToArray())).Key); var key = Encoding.UTF8.GetString(someKey.ToArray()); Assert.Equal(Challenge5Data.Key, key); }
void Start() { this._wasHacked = false; this._wasActivatedSpawn = false; this._timeToSpawn = SPAWNTIME; this._totalSpawn = 0; this._screenTransform = transform.FindChild("Screen"); this._lightObject = transform.FindChild("Light").GetComponent<Light>(); this._enemyObject = (GameObject)Resources.Load("Enemies/HumanoidRed"); this._spawnTransform = transform.FindChild("Spawn"); this._alarmMaterial = (Material)Resources.Load("Computer/Alarm"); this._hackedMaterial = (Material)Resources.Load("Computer/Hacked"); this._desactivatedMaterial = (Material)Resources.Load("Computer/Desactivated"); GameObject aux = GameObject.Find("Level"); this._challengeRing = aux.transform.GetComponent<Challenge3>(); this._challengeFinal = gameObject.transform.GetComponent<Challenge4>(); //Debug.Log("4: " + this._challengeFinal); this.ChangeTextureAndLight(this._desactivatedMaterial, Color.yellow); }
public void GetBestGuessSingleByteXorKey_EmptyByteArray_Throws() { Assert.Throws <ArgumentOutOfRangeException>(() => Challenge3.GetBestGuessSingleByteXorKey(new byte[0])); }
public void GetBestGuessSingleByteXorKey_NullByteArray_Throws() { Assert.Throws <ArgumentNullException>(() => Challenge3.GetBestGuessSingleByteXorKey((byte[])null)); }
public void GetBestGuessSingleByteXorKey_ValidHex_CorrectKey() { var result = Challenge3.GetBestGuessSingleByteXorKey("1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736"); Assert.Equal(0X58, result.Key); }