-2
I have a database that is encrypted by another system and I need to decrypt the data for display in the system made in symfony 3.
I have the decryption key and need to do this. I have little experience in Symfony.
How should I do this? It would be in Entity or Controller?
Look that answer
– Ivan Ferrer
@Ivanferrer, can you help me, please.
– fabricio_wm
I believe neither and neither. You can do this as a service, model or filter. It depends on what you are doing. The function of the controller is only true / false to trigger methods. The function of Entity has more to do with the entity you are dealing with. If your method belongs to the entity, then it would be within it.
– Ivan Ferrer
@Ivanferrer. I tried one like this but I have no idea how to do it.
'/**
 * Get nomePaiDecrypt 
 * @param string $nome, $chave 
 * @return string 
 */ 
 public function getNomeDecrypt($chave, $nome) 
 { 
 $chave = 'MIICeQIBADANBgkqhkiG9w0BAQEFAASC'; 
 $nome = $this->nome; 
 return CRYPT_EXT_DES($nome, $chave); 
 }
'– fabricio_wm
Look at the answer I posted.
– Ivan Ferrer
Where? I don’t get it. About using Entity or controller? Sorry but I don’t have symfony experience. The function is correct?
– fabricio_wm
In the other question.
– Ivan Ferrer
Can you post the link? I can’t find.
– fabricio_wm
Dude. Your other question is an SQL answer. What I need is how it looks in symfony. Gratefully.
– fabricio_wm
are you using Doctrine, or dql? Gives a look here
– Ivan Ferrer
Or Annotations?
– Ivan Ferrer
Your question does not contain enough information for an answer to what you want. SQL is the answer to the question of how to use
aes_decrypt
, how to enter this, depends on how you are making use of the connection.– Ivan Ferrer
is using ORM?
– Ivan Ferrer
Yes, @Ivanferrer. Symfony involves your resources.
– fabricio_wm
Ok, it’s already the first step for someone to answer your question, but you’d better edit your question and add: 1. the controller method that will call this request; 2. your Entity class. 3. the type of query you intend to execute in your database.
– Ivan Ferrer