Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. In this answer i have written the line2cipher and logMap function, i assume that the genAmpSeed and cipherchr() will be already defined as provided in the question.
  2.  
  3. password=input("Enter the password: ")
  4. amp,seed=genAmpSeed(password)
  5. line=input("Enter line to be ciphered: ")
  6.  
  7. def logMap(j,k):
  8. ans=(j*k)*(1-k)
  9. return ans
  10.  
  11. def line2cipher(amp,seed,line):
  12. acc=''
  13. for i in line[1:]:
  14. r=logMap(amp,seed)
  15. offset=int(96*r)
  16. acc+= cipherChr(i,offset)
  17. return amp, offset, acc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement