public string PartA() { EncryptionBreaker breaker = new EncryptionBreaker(DoorPublic, CardPublic); long encryptionKey = breaker.CrackEncryptionKey(); return(encryptionKey.ToString()); }
public void EncryptionBreaker_CrackEncryptionKey() { long doorPublic = 17807724; long cardPublic = 5764801; var sut = new EncryptionBreaker(doorPublic, cardPublic); var result = sut.CrackEncryptionKey(); Assert.Equal(14897079, result); }
public void EncryptionBreaker_FindLoopResults() { long doorPublic = 17807724; long cardPublic = 5764801; var sut = new EncryptionBreaker(doorPublic, cardPublic); var result = sut.FindLoopResults(); Assert.Equal(8, result.CardLoopSize); Assert.Equal(11, result.DoorLoopSize); }
public void EncryptionBreaker_TransformNumber() { long doorPublic = 17807724; long cardPublic = 5764801; var sut = new EncryptionBreaker(doorPublic, cardPublic); var cardResult = sut.TransformNumber(8, 7); Assert.Equal(cardPublic, cardResult); var doorResult = sut.TransformNumber(11, 7); Assert.Equal(doorPublic, doorResult); }