Namespaces
Variants
Actions
(Difference between revisions)

Como criptografar um texto usando QCryptographicHash, em Qt

Jump to: navigation, search
m (Hamishwillee - Tidy wiki text)
Line 1: Line 1:
[[Category:Lang-Portuguese]]
+
[[Category:Lang-Portuguese]][[Category:Qt]][[Category:Code Examples]][[Category:MeeGo]][[Category:Symbian]]
[[Category:Qt]]
+
{{ArticleNeedsUpdate|language=Lang-Portuguese|timestamp=20120215095903|user=[[User:Hamishwillee|<br />----]]|Example uses QCryptographicHash in a QWidget app framework. As QWidget is deprecated, should be updated to just show the use of the cryptographic hash. }}
[[Category:Code Examples]]
+
__NOTOC__
+
__NOEDITSECTION__
+
 
{{ArticleMetaData
 
{{ArticleMetaData
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
Line 15: Line 12:
 
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
 
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
 
|keywords=QCryptographicHash,QByteArray
 
|keywords=QCryptographicHash,QByteArray
|id=...
 
 
|language=Lang-Portuguese
 
|language=Lang-Portuguese
 
|translated-by=[[User:Valderind4]]
 
|translated-by=[[User:Valderind4]]
Line 26: Line 22:
 
|creationdate=20090922
 
|creationdate=20090922
 
|author=[[User:Mind freak]]
 
|author=[[User:Mind freak]]
 
<!-- The following items are not in the standard metadata template -->
 
|subcategory=UI
 
|category=Qt for S60
 
 
}}
 
}}
  
 
== Introdução ==
 
== Introdução ==
  
A classe QCryptographicHash provê um modo de gerar ''hashes'' de criptografia, podendo ser usada para ''hashes'' de criptografia de binários ou de dados de textos.
+
A classe {{Qapiname|QCryptographicHash}} provê um modo de gerar ''hashes'' de criptografia, podendo ser usada para ''hashes'' de criptografia de binários ou de dados de textos.
  
 
Este criptografia é usada quando você deseja enviar alguma informação de um modo seguro. O texto criptografado é chamado de texto ''chiper''.
 
Este criptografia é usada quando você deseja enviar alguma informação de um modo seguro. O texto criptografado é chamado de texto ''chiper''.
Line 94: Line 86:
  
 
[[Image:Crypto.JPG]]
 
[[Image:Crypto.JPG]]
<!-- Translation --> [[en:How to calculate hash for a text using QCryptographicHash in Qt]][[Category:MeeGo]] [[Category:Symbian]]
+
<!-- Translation --> [[en:How to calculate hash for a text using QCryptographicHash in Qt]]

Revision as of 12:59, 15 February 2012

Needs-update.png
Este artigo precisa ser atualizado: Se você achou esse artigo útil, por favor corrija os problemas relatados abaixo e depois retire do artigo o modelo {{ArticleNeedsUpdate}}, para que este aviso seja removido.

Motivos: hamishwillee (15 Feb 2012)
Example uses QCryptographicHash in a QWidget app framework. As QWidget is deprecated, should be updated to just show the use of the cryptographic hash.
Dados do artigo

Testado com
Aparelho(s): S60 Emulator

Compatibilidade
Plataforma(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition

Artigo
Palavras-chave: QCryptographicHash,QByteArray
Tradução:
Última alteração feita por hamishwillee em 15 Feb 2012

Contents

Introdução

A classe QCryptographicHash provê um modo de gerar hashes de criptografia, podendo ser usada para hashes de criptografia de binários ou de dados de textos.

Este criptografia é usada quando você deseja enviar alguma informação de um modo seguro. O texto criptografado é chamado de texto chiper.

Pré-requisitos

  • Baixe e instale a versão atual do Qt para Symbian segundo as instruções deste artigo.

Algumas funcionalidades relacionadas

  • Adiciona às informações hashes de criptografia.
QByteArray string="Nokia";
hash->addData(string);
  • Retorna o valor hash final.
QByteArray string1=hash->result();

Código fonte

Main.cpp

#include <QtGui/QApplication>
#include "textcodec.h"
#include<QWidget>
#include<QHBoxLayout>
#include <QCryptographicHash>
#include<QString>
#include<QByteArray>
#include<QLabel>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *win=new QWidget();
QHBoxLayout *lay=new QHBoxLayout();
QLabel *lbl=new QLabel();
QLabel *lbl1=new QLabel("Encrypted Text:");
lbl1->setBuddy(lbl);
QByteArray string="Nokia";
QCryptographicHash *hash=new QCryptographicHash(QCryptographicHash::Md4);
hash->addData(string);
QByteArray string1=hash->result();
lbl->setText(string1);
lay->addWidget(lbl1);
lay->addWidget(lbl);
win->setLayout(lay);
win->setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px ; color:rgb(255,255,255)}");
win->showMaximized();
return a.exec();
}

Captura de tela

Leia mais: QCryptographicHash

Crypto.JPG

147 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved