mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
hop
This commit is contained in:
parent
73ad7426ee
commit
54ece76c7e
@ -29,38 +29,69 @@
|
||||
<h4 class="title">Comment on a fait?</h4>
|
||||
|
||||
Voici notre alphabet autorisé ( {{ alphab.length }} caractères):
|
||||
<pre>
|
||||
{{ alphab }}
|
||||
</pre
|
||||
>
|
||||
<pre>{{ alphab }}</pre>
|
||||
Tout caractère qui n'est pas présent dans notre alphabet sera converti en souligné "_".
|
||||
<br />
|
||||
Notre texte après vérification : <code>{{ filterCharacters(plainText) }}</code>
|
||||
<br />
|
||||
On sépare le texte en {{ separatedCouples.length }} couples de caractères pour le mettre dans une matrice. On
|
||||
prend la pilule rouge.
|
||||
|
||||
<ul>
|
||||
<li *ngFor="let c; in: separecpl(plainText)">
|
||||
<pre class="debug padded warning">
|
||||
{{ c | json }}
|
||||
</pre
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
<fieldset class="couple" *ngFor="let c; in: separatedCouples">
|
||||
<!-- {{c[0]}}-->
|
||||
<!-- {{c[1]}}-->
|
||||
<pre class="debug padded warning">
|
||||
{{ c | json }}
|
||||
</pre
|
||||
>
|
||||
</fieldset>
|
||||
<pre class="debug padded warning">
|
||||
separatedCouples :
|
||||
{{ separatedCouples | json }}
|
||||
</pre
|
||||
<br />
|
||||
<span class="couple btn is-info" *ngFor="let c of separatedCouples"> [{{ c[0] }} , {{ c[1] }}] </span>
|
||||
<br />
|
||||
Pour chaque couple de caractères comme
|
||||
<span class="couple btn is-info">[{{ separatedCouples[0][0] }} , {{ separatedCouples[0][1] }}]</span>
|
||||
<br />
|
||||
on crée le couple d'indices de ces caractères.
|
||||
<code
|
||||
>[
|
||||
{{ dico.indexOf(separatedCouples[0][0]) }}
|
||||
,
|
||||
{{ dico.indexOf(separatedCouples[0][1]) }}
|
||||
]</code
|
||||
>
|
||||
<br />
|
||||
On
|
||||
<a href="https://fr.wikipedia.org/wiki/Produit_matriciel#Produit_matriciel_ordinaire">
|
||||
applique la matrice par produit
|
||||
</a>
|
||||
|
||||
<code>
|
||||
{{ convertStringToMatrix(codingMatrice) }}
|
||||
</code>
|
||||
au couple d'indices, ce qui donne:
|
||||
<br />
|
||||
<button class="btn is-info">
|
||||
{{
|
||||
applique(codingMatrice, [dico.indexOf(separatedCouples[0][0]), dico.indexOf(separatedCouples[0][1])])
|
||||
| json
|
||||
}}
|
||||
</button>
|
||||
<br />
|
||||
et on re convertit les indices en caractères selon notre dictionnaire.
|
||||
<button class="btn is-info">
|
||||
{{
|
||||
alphab[
|
||||
applique(codingMatrice, [
|
||||
dico.indexOf(separatedCouples[0][0]),
|
||||
dico.indexOf(separatedCouples[0][1])
|
||||
])[0]
|
||||
]
|
||||
}}
|
||||
{{
|
||||
alphab[
|
||||
applique(codingMatrice, [
|
||||
dico.indexOf(separatedCouples[0][0]),
|
||||
dico.indexOf(separatedCouples[0][1])
|
||||
])[1]
|
||||
]
|
||||
}}
|
||||
</button>
|
||||
<br />
|
||||
on accumule ces lettres converties dans la chaine msgout et on obtient tout notre texte chiffré.
|
||||
<code>
|
||||
{{ cipheredTextCIL }}
|
||||
</code>
|
||||
</section>
|
||||
<section class="boxed-shadow">
|
||||
<h3 class="title">1) Chiffrement simple</h3>
|
||||
|
Loading…
x
Reference in New Issue
Block a user