Esto me pasa por no leer bien el enunciado xd, en clase más de lo mismo.
Congrats
Congrats

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúYou are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or LoginNo bro, tu code esta erroneo, de esta manera solo podrias cifrar.
Nosé si la sintaxis esta bien pero así se resume a la mitad:Código: python def progresivo(s, n, o):
encoded = [ord(s[0]) + n,]
decoded = [ord(s[0]) - n,]
for i in s[1::]:
if o == 1:
encoded.append(ord(i) + encoded[-1])
elif o == 0:
decoded.append(ord(i) - decoded[-1])
print "".join([unichr(x) for x in encoded])
def progresivo(s, n, o):
encoded = [ord(s[0]) + n,]
decoded = [ord(s[0]) - n,]
if o == 1:
for i in s[1::]:
encoded.append(ord(i) + encoded[-1])
print "".join([unichr(x) for x in encoded])
elif o == 0:
for i in s[1::]:
decoded.append(ord(i) - decoded[-1])
print "".join([unichr(x) for x in decoded])
#Params: s = Texto a cifrar o descifrar | n = key | o = 1 -> cifrar, o = 0 -> descifrar
#progresivo('sanko', 2, 1) -> output example uÖńƯȞ#Params | x = texto a cifrar | si z es 1 -> cifrar , cualquier otro valor -> descifrar
print "".join((lambda x, z: [unichr(int(i[2]+i[0]+i[1])) if z == 1 else unichr(int(i[1]+i[2]+i[0])) for i in ['{0:03}'.format(ord(z)) for z in x]])('hola', 1))xAbc = 'LUCIFER213'
def xEnc(s, n):
print "".join([xAbc[int(x)] for x in [z for z in "".join(['{0:03}'.format((ord(a) + n)) for a in s])]])
def xDec(s, n):
print "".join(chr(int("".join([str(xAbc.find(x)) for x in s[i:i+3]]))-n) for i in range(0,len(s),3))
#xEnc('Hola puta.', 20)
#xDec('L3CUIUUC1UU2LECUICUI2UIRUU2LRR', 20)You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or LoginEl estudio de malware es ético mientras no se haga alarde de cómo propagarlo, en mi opinión vayaYou are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Esta muy bien el esfuerzo y el curro, pero ponerle el logo de underc0de a la aplicación igual ha sido pasarse, estas relaccionando un foro de hacking ético con usos no éticos.
Es algo asi como esto?
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
y se podría seguir numerando casos iguales, "foro de hacking ético" eso se puede discutir sin ánimos de ofender!
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Tanto en la linea 4, como en la 11, del segundo codigo me parece que te confundiste:Código: python encode += chr((lambda x, y: ord(x) + y)(i, 2))
Al final me parece que tiene que ir (i,n) no (i,2)
las prisas, gracias por avisar ya edito
def piramide(lines):
for i in range(lines):
x = lines - i - 1
z = i * 2 + 1
print " " * x + "*" * z
class RSA:
#initializing
def __init__(self, p, q):
self.p = p
self.q = q
#defining n and z to resolve ops
self.n = p * q
self.z = (p-1) * (q-1)
self.e = self.z - 1
"""
def _extD():
for self.d in range(1, 100):
if (self.e * self.d) % self.z == 1:
return self.d
return self.d
_extD()
"""
self.encoded = []
self.decoded = []
# func to extract chars from a string
def _extChar(self, text):
self.text = text
if text:
self._encode(text[0])
self._encode(self._extChar(text[1:]))
#recive a char from extChar
def _encode(self, m):
self.m = m
if m:
m = ord(m)
c = (m ^ self.e) % self.n
self.encoded.append(c)
"""
def _decode(self, m):
self.m = m
if m:
c = (m ^ self.d) % self.n
self.decoded.append(c)
"""
#ejemplo de uso
obj = RSA(3, 5)
obj._extChar("hola sanko")
print obj.encoded #output: [6, 14, 2, 12, 9, 11, 12, 0, 3, 14]You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or LoginCorrecta errónea, cada vez son más las empresas que prefieren la experiencia en su campo antes que un título teórico, tengo muchos amigos trabajando codo con codo con ingenieros y ellos tan solo han hecho un FP.You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
La mejor carrera que vas a tener es ser autodidacta. Aunque las de galgos no están nada mal.
Lamentablemente en el mundo de hoy el titulo vale mas que el conocimiento
Saludos
Destructor