聚合‘HMAC_CTX tx’类型不完全,无法被定义 10C

linux环境下(安装了openssl库),我用openssl去解析,hash和MD5,MD5可以解析,但是HMAC_CTX限制不识别。我同时调用了 和,就大神帮忙解决

2个回答

HMAC_CTX *ctx = HMAC_CTX_new();

openssl 版本不同, 代码有差异

端口聚合它可将多物理连接当作一个单一的逻辑连接来处理,它允许两个交换器之间通过多个端口并行连接同时传输数据以提供更高的带宽、更大的吞吐量和可恢复性的技术。 一般来说,两个普通交换器连接的最大带宽取决于媒介的连接速度(100BAST-TX双绞线为200M),而使用Trunk技术可以将4个200M的端口捆绑后成为一个高达800M的连接。这一技术的优点是以较低的成本通过捆绑多端口提高带宽,而其增加的开销只是连接用的普通五类网线和多占用的端口,它可以有效地提高子网的上行速度,从而消除网络访问中的瓶颈。另外Trunk还具有自动带宽平衡,即容错功能:即使Trunk只有一个连接存在时,仍然会工作,这无形中增加了系统的可靠性

qq_29689609
qq_29689609 我想要问的不是端口聚合,只是想知道为什么系统不识别HMAC_CTX
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
C++ 使用Openssl进行HMAC- sha256加密

bool calc_HMAC_SHA256(const std::string &key, const std::string &input, std::string *hmac) { unsigned char md[32] = { 0 };//32 bytes char format_md[65] = { 0 }; unsigned int md_len = sizeof(md); HMAC_CTX ctx; HMAC_CTX_init(&ctx); if (!HMAC_Init_ex(&ctx, key.data(), (int)key.length(), EVP_sha256(), NULL) || !HMAC_Update(&ctx, (const unsigned char *)input.data(), input.length()) || !HMAC_Final(&ctx, md, &md_len)) { HMAC_CTX_cleanup(&ctx); return false; } HMAC_CTX_cleanup(&ctx); for (int i = 0; i < 32; i++) { snprintf(&format_md[i * 2], 3, "%02x", md[i]); //二进制转为十六进制大写 } hmac->assign(format_md); // 转大写 transform(hmac->begin(), hmac->end(), hmac->begin(), ::toupper); return true; } openssl已经导入,lib也引用了,运行时 CloudPayInfo.obj : error LNK2001: 无法解析的外部符号 _EVP_sha256 1>CloudPayInfo.obj : error LNK2001: 无法解析的外部符号 _HMAC_CTX_init 1>CloudPayInfo.obj : error LNK2001: 无法解析的外部符号 _HMAC_CTX_cleanup 1>CloudPayInfo.obj : error LNK2001: 无法解析的外部符号 _HMAC_Init_ex 1>CloudPayInfo.obj : error LNK2001: 无法解析的外部符号 _HMAC_Update 1>CloudPayInfo.obj : error LNK2001: 无法解析的外部符号 _HMAC_Final 请问大佬们怎么解决啊?

HMAC_SHA1在PHP和Lua上有所不同

<div class="post-text" itemprop="text"> <p>I'm trying to generate a HMAC_SHA1 in php, and validate it in openresty lua</p> <p>PHP Code:</p> <pre><code>$hmac_sha1 = hash_hmac('sha1', 'test', 'gabri', true); echo base64_encode($hmac_sha1); </code></pre> <p>Which produces:</p> <pre><code>/ReAJgDe67/lF3BNbaGSCx70J/c= </code></pre> <p>And the same code in lua:</p> <pre><code>local hmac_sha1 = ngx.hmac_sha1("test", "gabri") ngx.log(ngx.NOTICE, ngx.encode_base64(hmac_sha1) ); </code></pre> <p>produces:</p> <pre><code>Yczcenrc2EAOpfm9UEWwME9XLRI= </code></pre> <p>Why are they different?</p> <p>In PHP, I've included the 4th parameter on hash_hmac, which return the data as raw binary</p> <p>As per: <a href="https://github.com/openresty/lua-nginx-module#ngxhmac_sha1" rel="nofollow noreferrer">https://github.com/openresty/lua-nginx-module#ngxhmac_sha1</a></p> <blockquote> <p>The raw binary form of the HMAC-SHA1 digest will be generated, use ngx.encode_base64, for example, to encode the result to a textual representation if desired.</p> </blockquote> </div>

java和php的hmac_sha1结果不同,求高手帮忙

最近遇到hmac_sha1跨语言加密的问题,只提供给了java加密文件,没提供php的,我用php hmac_sha1内置函数,得到的sig加密结果不同,欢迎高手帮忙提供相对应的php代码,提供的java类如下 欢迎加QQ: 847036019 public abstract class Coder { public static final String KEY_SHA = "SHA"; public static final String KEY_MD5 = "MD5"; public static final char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; public static final String KEY_MAC = "HmacSHA1"; public static byte[] decryptBASE64(String key) throws Exception { return (new BASE64Decoder()).decodeBuffer(key); } /** * 初始化HMAC密钥 */ public static String initMacKey() throws Exception { KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_MAC); SecretKey secretKey = keyGenerator.generateKey(); return encryptBASE64(secretKey.getEncoded()); } /** * HMAC加密 */ public static byte[] encryptHMAC(byte[] data, String key) throws Exception { SecretKey secretKey = new SecretKeySpec(decryptBASE64(key), KEY_MAC); Mac mac = Mac.getInstance(secretKey.getAlgorithm()); mac.init(secretKey); return mac.doFinal(data); } public static void main(String[] args) { try { String param = ''; String appkey = ''; byte[] bytes = Coder.encryptHMAC((param).getBytes("utf-8"), appkey);//['-115','-101','97','-26','-80','-109','-92','33','-6','71','-122','-64','-17','-29','-101','-53','88','-93','-22','-104'] String sig = new BigInteger(bytes).toString();//-653068794747578802236590292838260814592085857640 System.out.println("sig:" + sig); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } java sig得出来的结果为 -653068794747578802236590292838260814592085857640 php我用相对应的加密即php自带函数 $signature = mhash(MHASH_SHA1,$sigstr,base64_decode($appkey)); $hash = str_split($signature); foreach ($hash as $index=>$value) { if (ord($value)>128) { $hash[$index] = ord($value)-128*2; } else { $hash[$index] = ord($value); } } php得到的ascii数组为$array('-115','-101','97','-26','-80','-109','-92','33','-6','71','-122','-64','-17','-29','-101','-53','88','-93','-22','-104'); 请问该php如何处理得到下面的值 -653068794747578802236590292838260814592085857640 java用的是new BigInteger(bytes).toString();php该如何处理

PHP中的Hmac-sha1

<div class="post-text" itemprop="text"> <p>I've spent several hours reading through many posts already trying to get this to work and am still having issues with it. I'm trying to use the protectedpdf api which requires a three step process to login and receive an auth token, involving the hmac_sha1 hashing algorithm. </p> <p>I'm making use of the hmac_hash() function in php so the code is simply:</p> <pre><code>$accessKey = "test"; $dataString = strtolower((string)$clientNonce.(string)$serverNonce.$accesskey); $clientHash = strtoupper(hash_hmac('sha1', $dataString, $accessKey)); </code></pre> <p>Where ClientNonce and ServerNonce are uuids like <code>30df805c-27d6-4df1-b482-48b685cc8f54</code></p> <p>For a sample set of Client and Server Nonces, the built-in php function returns: <code>C39B753E50DB06DF3DE8E41C682FA8151B49ECBD</code> and i get an authentication error in response to the login attempt.</p> <p>Using the free formatter hmac generator online tool the same input yields: <code>7f48c3018c0e53a0b64a60bb7809c7a20a80c9a2</code></p> <p>I would greatly appreciate any help - thanks!!!</p> </div>

openssl EVP_DecryptFinal_ex 错误

在做chrome cookie Decrypt的功能小工具。 目前遇到问题EVP_DecryptFinal_ex 的时候经常返回值为0。 知道是padding的问题,但是不知道到底该如何处理这个padding。有大神指导一下吗。 ``` #include <iostream> #include <string> #include <openssl/conf.h> #include <openssl/evp.h> #include <openssl/err.h> #include <openssl/aes.h> #include <openssl/rand.h> #include <openssl/hmac.h> #include <openssl/engine.h> #include "sqlite3.h" using namespace std; const char kSalt[] = "saltysalt"; const int kDerivedKeySizeInBits = 128; const int kEncryptionIterations = 1003; const char kEncryptionVersionPrefix[] = "v10"; struct Param { string pass; string host; string key; }; static std::string &rtrim(std::string &s) { s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); return s; } bool deriveKeyFromPassword(const char *password, int pass_len, const unsigned char *salt, int salt_len, unsigned char *out) { if(PKCS5_PBKDF2_HMAC_SHA1(password, pass_len, salt, salt_len, kEncryptionIterations, kDerivedKeySizeInBits/8, out) != 0) { return true; } else { cout << "0.PKCS5_PBKDF2_HMAC_SHA1 failed\n"; return false; } } int decrypt(const unsigned char *ciphertext, int ciphertext_len, const unsigned char *key, const unsigned char *iv, unsigned char *plaintext) { EVP_CIPHER_CTX *ctx; int len; int plaintext_len = -1; if(!(ctx = EVP_CIPHER_CTX_new())) { ERR_print_errors_fp(stderr); return -1; } if(1 != EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv)) { ERR_print_errors_fp(stderr); return -1; } // EVP_CIPHER_CTX_set_padding(ctx, 0); if(1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len)) { ERR_print_errors_fp(stderr); goto CLEARUP; } plaintext_len = len; if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len)) { ERR_print_errors_fp(stderr); plaintext_len = -1; goto CLEARUP; } plaintext_len += len; CLEARUP: EVP_CIPHER_CTX_free(ctx); return plaintext_len; } bool chrome_decrypt(const string& password, const string &enc_value, string *dec_value) { if (enc_value.find(kEncryptionVersionPrefix) != 0) { cout << "invalid encrypted data\n"; return false; } string raw_enc_value = enc_value.substr(strlen(kEncryptionVersionPrefix)); unsigned char iv[AES_BLOCK_SIZE] = {0}; memset(iv, ' ', AES_BLOCK_SIZE); unsigned char *decryptedtext = new unsigned char[raw_enc_value.size() + 64]; int decryptedtext_len = 0; bool ret = false; unsigned char aes_key[kDerivedKeySizeInBits/8] = {0}; if (deriveKeyFromPassword(password.c_str(), password.size(), (unsigned char *)kSalt, (int)strlen(kSalt), aes_key)) { decryptedtext_len = decrypt((const unsigned char *)raw_enc_value.c_str(), raw_enc_value.size(), aes_key, iv, decryptedtext); if (decryptedtext_len > 0) { *dec_value = string((char *)decryptedtext, decryptedtext_len); ret = true; } } delete[] decryptedtext; return ret; } int db_callback(void* param, int row_count, char** argv, char** col_name) { Param* _param = (Param*)param; if (!_param->host.empty() && argv[1] != _param->host) return 0; bool show_detail = _param->key.empty(); for(int i = 0; i < row_count; i++) { if (show_detail) { if (i == 12) { string value = ""; chrome_decrypt(_param->pass, argv[i], &value); cout << col_name[i] << ": " << rtrim(value) << "\n"; } else { cout << col_name[i] << ": " << argv[i] << "\n"; } } else { if (argv[2] == _param->key && i == 12) { string value = ""; chrome_decrypt(_param->pass, argv[i], &value); cout << rtrim(value) << value.length() << "\n"; } } } if (show_detail) cout << "--------------------------------------------\n"; return 0; } void read_db(const string& db_path, const string& password, const string& host, const string& key) { sqlite3* handle = NULL; sqlite3_open(db_path.data(), &handle); if (handle == NULL) { cout << "打开cookie数据库失败!"; return; } sqlite3_stmt* stmp = NULL; Param param; param.pass = password; param.host = host; param.key = key; char* error = NULL; string sql = "select * from cookies"; sqlite3_exec(handle, sql.data(), db_callback, (void*)(&param), &error); sqlite3_close(handle); } int main(int argc, const char * argv[]) { // read_db("/Users/bitebit/Library/Application Support/Google/Chrome/Default/Cookies", "F3/F95DvICIA==", "", ""); // read_db("/Users/bitebit/Library/Application Support/Google/Chrome/Default/Cookies", "F3/F95DvICIA==", "10.2.69.69", ""); // read_db("/Users/bitebit/Library/Application Support/Google/Chrome/Default/Cookies", "F3/F95DvICIA==", "10.2.69.69", "LBCLUSTERID"); if (argc < 3) { cout << "使用方法: \n\t decryptor cookie文件路径 chrome钥匙串 [cookie的host] [cookie的名字]\n" << endl; cout << "Mac下获取chrome钥匙串: \n\t security find-generic-password -w -s \"Chrome Safe Storage\"" << endl; return 1; } if (argc == 5) read_db(argv[1], argv[2], argv[3], argv[4]); else if (argc == 4) read_db(argv[1], argv[2], argv[3], ""); else if (argc == 3) read_db(argv[1], argv[2], "", ""); return 0; } ```

PHP中的HMAC md5加密/解密[重复]

<div class="post-text" itemprop="text"> <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/15194663/encrypt-and-decrypt-md5" dir="ltr">encrypt and decrypt md5</a> <span class="question-originals-answer-count"> 6 answers </span> </li> </ul> </div> <p>I have the php code for making HMAC md5 encryption</p> <pre><code>$input = 'foo'; $output = hash_hmac('md5', $input, $secretKey); </code></pre> <p>After making the hash,is there anyway I could get the $input back to text form.</p> </div>

如何通过PKCS5_PBKDF2_HMAC和hash_hmac在C和php中获得相同的输出

<div class="post-text" itemprop="text"> <p>I'm trying to duplicate a hashing function in C to be used on an existing database of hashes and salts. However once I reduced how PHP gets a sha256 hash and how c gets one, I can't get the same hashes. </p> <p>I have looked though quite a few methods of getting the same hashes in C, but I can't quite figure out what's wrong the C code. The C code works, but the output is not the same.</p> <p>Here is the base of my PHP code, it takes password and uses a single space as a salt, the rest of the code is just to visualize and see the output:</p> <pre><code>&lt;?php $salt = ' '; $password = 'password'; $temp1 = hash_hmac('sha256', $salt, $password, true); echo "====================== &lt;br&gt;"; echo "password [${password}] &lt;br&gt;"; echo "salt [${salt}] &lt;br&gt;"; echo "====================== &lt;br&gt;"; echo gettype($temp1) . " &lt;br&gt;"; echo "each char as dechex(ord(x)) &lt;br&gt;"; for ($i = 0; $i &lt; strlen($temp1); ++$i) { $x = dechex(ord($temp1[$i])); echo "[$x] "; } echo "------------------------- &lt;br&gt;"; echo "base64_encode &lt;br&gt;"; echo base64_encode($temp1)." &lt;br&gt;"; ?&gt; </code></pre> <p>and the output</p> <pre><code>====================== password [password] salt [ ] ====================== string each char as dechex(ord(x)) [52] [33] [c] [6b] [2f] [b6] [22] [cd] [bb] [73] [93] [c2] [5c] [be] [6c] [f4] [d3] [a6] [26] [cc] [ef] [aa] [9] [5e] [e0] [93] [33] [8] [83] [8d] [9] [63] ------------------------- base64_encode UjMMay+2Is27c5PCXL5s9NOmJszvqgle4JMzCIONCWM= </code></pre> <p>The C I'm using, this is the simplest of examples I could find. I am only looking to get the same hash output. It does not have to use this method. I also included the base64 include function I'm using just in case:</p> <pre><code> #include &lt;string.h&gt; #include &lt;stdio.h&gt; #include &lt;openssl/evp.h&gt; #include &lt;openssl/sha.h&gt; #include &lt;openssl/pem.h&gt; #include &lt;openssl/hmac.h&gt; #define PBKDF2_DIGEST_LENGTH SHA256_DIGEST_LENGTH #define PBKDF2_SALT_PREFIX "" #define PBKDF2_SALT_PREFIX_LENGTH strlen(PBKDF2_SALT_PREFIX) #define PBKDF2_PRF_ALGORITHM_OLD EVP_sha512() #define PBKDF2_DIGEST_LENGTH_OLD SHA512_DIGEST_LENGTH #define PBKDF2_SALT_LENGTH 32 #define PBKDF2_RESULT_LENGTH PBKDF2_SALT_PREFIX_LENGTH + (2 * PBKDF2_DIGEST_LENGTH) + PBKDF2_SALT_LENGTH + 2 #define PBKDF2_ROUNDS 1000 #define PBKDF2_PRF_ALGORITHM EVP_sha256() char *base64encode (const void *b64_encode_this, int encode_this_many_bytes){ BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory sink BIO. BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-sink BIO chain. BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //No newlines every 64 characters or less. BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); //Records base64 encoded data. BIO_flush(b64_bio); //Flush data. Necessary for b64 encoding, because of pad characters. BIO_get_mem_ptr(mem_bio, &amp;mem_bio_mem_ptr); //Store address of mem_bio's memory structure. BIO_set_close(mem_bio, BIO_NOCLOSE); //Permit access to mem_ptr after BIOs are destroyed. BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); //Makes space for end null. (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail. return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct). } int main(void) { static unsigned char hb[PBKDF2_DIGEST_LENGTH]; static unsigned char hashBlock[PBKDF2_DIGEST_LENGTH]; char *password = "password"; char *salt = " "; int passes = 1; PKCS5_PBKDF2_HMAC(password, strlen(password), salt, strlen(salt) , passes, PBKDF2_PRF_ALGORITHM, PBKDF2_DIGEST_LENGTH, hb); unsigned int i = 0; printf("printf hex "); while(i&lt;32) { printf("[%x] ", hb[i]); ++i; } printf(" "); printf("base-64 encode "); printf("%s ", base64encode(hb, 32)); return 0; } </code></pre> <p>The output that C produces, basically to visualize the output:</p> <pre><code> ./pbkdf2_hack printf hex [f8] [8b] [fe] [58] [64] [f8] [a] [ef] [c0] [da] [b2] [97] [42] [ce] [b3] [83] [67] [85] [a5] [f2] [c8] [94] [7b] [2d] [82] [5d] [8a] [a5] [c0] [46] [9a] [24] base-64 encode +Iv+WGT4Cu/A2rKXQs6zg2eFpfLIlHstgl2KpcBGmiQ= </code></pre> <p>Compiling, in case something needs to be different here:</p> <pre><code>gcc pbkdf2_example.c -lcrypto -o pbkdf2_example </code></pre> </div>

C#中的原始HMAC-SHA1 - hmac_hash()PHP等效

<div class="post-text" itemprop="text"> <p>I am attempting to integrate Desk.com's Multipass SSO into my website, and am having trouble generating the correct HMAC-SHA1 signature (so say the error logs). Here are the directions from Desk.com's website:</p> <ol> <li>Build a SHA1 HMAC using your multipass API key and your finished multipass token.</li> <li>Base64 encode the resulting HMAC.</li> </ol> <p>According to the logs, my multipass token appears to be correct. First, the code in PHP that works perfectly:</p> <pre><code>// Build an HMAC-SHA1 signature using the multipass string and your API key $signature = hash_hmac("sha1", $multipass, $api_key, true); // Base64 encode the signature $signature = base64_encode($signature); </code></pre> <p>^ note that hash_hmac's 'true' value is outputting information in raw binary - I'm not sure if this is the case in my C# code</p> <p>Next, my C# code that is <em>not</em> working correctly:</p> <pre><code>protected string getSignature(string multipass) { string api_key = "my_key_goes_here"; HMACSHA1 hmac = new HMACSHA1(Encoding.ASCII.GetBytes(api_key)); hmac.Initialize(); byte[] buffer = Encoding.ASCII.GetBytes(multipass); string signature = BitConverter.ToString(hmac.ComputeHash(buffer)).Replace("-", "").ToLower(); return Convert.ToBase64String(Encoding.ASCII.GetBytes(signature)); } </code></pre> <p>This is the result of (literally) hours of searching and trying multiple different ways. I would be very grateful if I could get this figured out. </p> <p>If you need a reference, check out this page by Desk.com: <a href="http://dev.desk.com/docs/portal/multipass" rel="nofollow">http://dev.desk.com/docs/portal/multipass</a>. It has code examples and outlines the instructions for completing the code.</p> <p>Edit: here is my multipass generation code.</p> <pre><code>protected string getMultipass(UserData user_data) { // Encode the data into a JSON object JavaScriptSerializer s = new JavaScriptSerializer(); string json_data = s.Serialize(user_data); // Acquire the Web.config appSettings string site_key = "my_site_here"; string api_key = "my_key_here"; string iv = "OpenSSL for Ruby"; // Using byte arrays now instead of strings byte[] encrypted = null; byte[] bIV = Encoding.ASCII.GetBytes(iv); byte[] data = Encoding.ASCII.GetBytes(json_data); // XOR the first block (16 bytes) // once before the full XOR // so it gets double XORed for (var i = 0; i &lt; 16; i++) data[i] = (byte)(data[i] ^ bIV[i]); // Pad using block size of 16 bytes int pad = 16 - (data.Length % 16); Array.Resize(ref data, data.Length + pad); for (var i = 0; i &lt; pad; i++) data[data.Length - pad + i] = (byte)pad; // Use the AesManaged object to do the encryption using (AesManaged aesAlg = new AesManaged()) { aesAlg.IV = bIV; aesAlg.KeySize = 128; // Create the 16-byte salted hash SHA1 sha1 = SHA1.Create(); byte[] saltedHash = sha1.ComputeHash(Encoding.UTF8.GetBytes(api_key + site_key), 0, (api_key + site_key).Length); Array.Resize(ref saltedHash, 16); aesAlg.Key = saltedHash; // Encrypt using the AES managed object ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); using (MemoryStream msEncrypt = new MemoryStream()) { using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) { csEncrypt.Write(data, 0, data.Length); csEncrypt.FlushFinalBlock(); } encrypted = msEncrypt.ToArray(); } } // Return the Base64-encoded encrypted data return Convert.ToBase64String(encrypted, Base64FormattingOptions.None) .TrimEnd("=".ToCharArray()) // Remove trailing "=" characters .Replace("+", "-") // Change "+" to "-" .Replace("/", "_"); // Change "/" to "_" } </code></pre> </div>

生成用户唯一的hmac密钥以进行密码散列

<div class="post-text" itemprop="text"> <p>For my website's password hashing I wrote the following function:</p> <pre><code>public function hash($user) { $user_key = hash_hmac('sha512', $user['id'].$user['email'], $this-&gt;site_key); $password = hash_hmac('sha512', $user['password'], $user_key); } </code></pre> <p>I generate user unique keys to use for the final password hashing. Because this key is hashed with sha512 it should give enough security based on what I read on wikipedia: </p> <blockquote> <p>The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function, the size of its hash output length in bits and on the size and quality of the cryptographic key.</p> </blockquote> <p>I have not seen this way if hashing passwords before and was wondering if it is good enough?</p> <p><strong>Extra</strong>: I have not used a salt because I <em>think</em> hmac appends the provided key to the data (like a salt), is this right?</p> </div>

wpa_supplicant编译时出现 undefined reference to `sha256_vector'

CC ../src/drivers/drivers.c CC ../src/l2_packet/l2_packet_linux.c ../src/wps/wps_common.o: In function `wps_derive_keys': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/wps/wps_common.c:101: undefined reference to `sha256_vector' ../src/wps/wps_enrollee.o: In function `wps_process_pubkey': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/wps/wps_enrollee.c:519: undefined reference to `sha256_vector' ../src/crypto/tls_openssl.o: In function `openssl_tls_cert_event': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/tls_openssl.c:1346: undefined reference to `sha256_vector' ../src/crypto/tls_openssl.o: In function `tls_verify_cb': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/tls_openssl.c:1421: undefined reference to `sha256_vector' ../src/crypto/crypto_openssl.o: In function `crypto_hash_init': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/crypto_openssl.c:620: undefined reference to `EVP_sha256' ../src/crypto/crypto_openssl.o: In function `hmac_sha256_vector': /home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant/../src/crypto/crypto_openssl.c:754: undefined reference to `EVP_sha256' collect2: error: ld returned 1 exit status make: *** [wpa_supplicant] Error 1 root@atheros:/home/atheros/Atheros-P2P/wpa_supplicant-2.1/wpa_supplicant#

跪求:HMAC-MD5的算例,用于验证

自己根据网上的资料改了一段HMAC-MD5的代码,希望能有实例验证一下是否正确,例如: 已知公共密钥key和需要加密的数据流data,求HMAC-MD5结果 char* key="abcde"; UNCHAR data[]={{ 0x01 ,0x00 ,0x00 ,0xad ,0x06 ,0x34, 0x1f ,0xd8 ,0x04 ,0x02 ,0x1b ,0x4a ,0x57 ,0x6f ,0x7b ,0xd4 ,0x7a ,0x4a ,0x5d ,0x4e ,0x50 ,0x12, 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00, 0x06 ,0x06 ,0x00 ,0x00 ,0x00 ,0x02 ,0x01 ,0x0a ,0x31 ,0x32 ,0x33 ,0x34 ,0x35 ,0x36 ,0x37 ,0x00, 0x0c ,0x06 ,0x00 ,0x00 ,0x05 ,0xd0 ,0x1e ,0x18 ,0x30 ,0x30 ,0x2d ,0x32 ,0x37 ,0x2d ,0x31 ,0x39, 0x2d ,0x39 ,0x46 ,0x2d ,0x41 ,0x44 ,0x2d ,0x32 ,0x41 ,0x3a ,0x7a ,0x72 ,0x6c ,0x74 ,0x1f ,0x13, 0x30 ,0x30 ,0x2d ,0x32 ,0x33 ,0x2d ,0x31 ,0x34 ,0x2d ,0x45 ,0x33 ,0x2d ,0x36 ,0x30 ,0x2d ,0x39, 0x30 ,0x3d ,0x06 ,0x00 ,0x00 ,0x00 ,0x13 ,0x4d ,0x18 ,0x43 ,0x4f ,0x4e ,0x4e ,0x45 ,0x43 ,0x54, 0x20 ,0x35 ,0x34 ,0x4d ,0x62 ,0x70 ,0x73 ,0x20 ,0x38 ,0x30 ,0x32 ,0x2e ,0x31 ,0x31 ,0x67 ,0x4f, 0x0e ,0x02 ,0x00 ,0x00 ,0x0c ,0x01 ,0x31 ,0x32 ,0x33 ,0x34 ,0x35 ,0x36 ,0x37 ,0x04 ,0x06 ,0xc0, 0xa8 ,0x01 ,0x05 ,0x05 ,0x06 ,0x00 ,0x00 ,0x00 ,0x01 ,0x57 ,0x0e ,0x53 ,0x54 ,0x41 ,0x20 ,0x70, 0x6f ,0x72 ,0x74 ,0x20 ,0x23 ,0x20 ,0x31 }; ``` ```

Apache Modulue开发中遇到的问题,关于openssl加密,总是报错,错在哪里?

char *iaisession_getobmuid(request_rec *r, const char *encid, const unsigned char *enckey, unsigned char *iv, const char *mtiid) { unsigned char *obmuid = (unsigned char *) apr_pcalloc(r->pool, LENGTH_OBMUID + 1); char *b64edobmuid; // get muid length int mtiidlen = strlen(mtiid); // encrypted obmuid length int obmuidlen = 0; // padding length int paddinglen = 0; // according to the key length, decide 128bit or 256bit AES encryption algorithm. const EVP_CIPHER *aes_cbc = NULL; int keylen = strlen((char *)enckey); if (keylen == LENGTH_KEY_16) { aes_cbc = EVP_aes_128_cbc(); } else if (keylen == LENGTH_KEY_32) { aes_cbc = EVP_aes_256_cbc(); } // cipher contex EVP_CIPHER_CTX ctx; // initializes cipher contex. EVP_CIPHER_CTX_init(&ctx); // sets up cipher context ctx for encryption with cipher type from ENGINE (default implementation). EVP_EncryptInit_ex(&ctx, aes_cbc, NULL, enckey, iv); // encrypts mtiidlen bytes from the mtiid in and writes the encrypted version to obmuid. EVP_EncryptUpdate(&ctx, obmuid, &obmuidlen, (unsigned char *)mtiid, mtiidlen); // obmuid is the encrypts. EVP_EncryptFinal_ex(&ctx, obmuid + obmuidlen, &paddinglen); // clears all information from a cipher context and free up any allocated memory associate with it. EVP_CIPHER_CTX_cleanup(&ctx); // base64 encode b64edobmuid = iaisession_encodebybase64(r->pool, obmuid); return b64edobmuid; } [Wed Jul 03 01:43:13 2013] [notice] child pid 28278 exit signal Segmentation fault (11)

关于hash_hmac("MD5", "aa=11&bb=2&c=lai")

![图片说明](https://img-ask.csdn.net/upload/201708/20/1503214664_744015.png) 大家好,我是开发java的,最近遇到一个和php相关的问题,想和大家请教一下 hash_hmac(“MD5”, "a=1&b=data&c=2","私钥") php的这个函数内部是怎么实现的,我目前需要用java做一个签名函数,和php的hash_hmac函数功能一致,网上搜索的都使用不了,所以想知道这个函数底层源码是怎么实现的,这样我就可以用java实现了 搜索到一个阿里的技术文档,内容如下,但是无法使用: public static byte[] encryptHMAC(String data, String secret) throws Exception { byte[] bytes = null; try { SecretKey secretKey = new SecretKeySpec(secret.getBytes(Constants.ENCODE_UTF8), "HmacMD5"); Mac mac = Mac.getInstance(secretKey.getAlgorithm()); mac.init(secretKey); bytes = mac.doFinal(data.getBytes(Constants.ENCODE_UTF8)); } catch (Exception gse) { throw new IOException(gse.toString()); } return bytes; } public static String byte2hex(byte[] bytes) { StringBuilder sign = new StringBuilder(); for (int i = 0; i < bytes.length; i++) { String hex = Integer.toHexString(bytes[i] & 0xFF); if (hex.length() == 1) { sign.append("0"); } sign.append(hex.toUpperCase()); } System.out.println(sign.toString().toLowerCase()); return sign.toString().toLowerCase(); }

如何在节点js中使用hash_hmac函数

<div class="post-text" itemprop="text"> <p>Recently I have used same code on PHP and it's working fine but when I tried Node Js, it's not working for me. Please check once: </p> <p>PHP </p> <pre><code>$signature = $ACCID . "POST" . strtolower(urlencode($url)).$requestContentBase64String; $hmacsignature = base64_encode(hash_hmac("sha256", $signature, base64_decode($APIKey), true)); </code></pre> <p>NODE CODE : </p> <pre><code>var signature = ACCID+"POST"+encodeURI(url).toLowerCase()+requestContentBase64String; var hmacsignature = base64.encode(crypto.createHmac('sha256', APIKey).update(signature).digest('base64')) </code></pre> <p>Please check what's wrong in this code. </p> </div>

PHP sha512 hmac产生的值与JS hmac不同

<div class="post-text" itemprop="text"> <p>Here is some of my JS code. I am creating the hmac using Crypto, then passing in the date and signature as request headers to use in PHP:</p> <pre class="lang-js prettyprint-override"><code>events: { proxyReq: (proxyReq, req) =&gt; { const date = Date.now(); const API_KEY = 125; const API_SECRET_KEY = 'abc'; const s = new Buffer(API_SECRET_KEY, 'base64'); const message = req.method + req.url + date; let hmac = crypto.createHmac('sha512', s); const signature = hmac.update(message).digest('base64'); proxyReq.setHeader('x-api-key', API_KEY); proxyReq.setHeader('x-api-signature', signature); proxyReq.setHeader('x-api-date', date); }, }, </code></pre> <p>Here is my PHP function where I try to reproduce the same hmac using hash_hmac():</p> <pre><code>public function handle($request, \Closure $next) { try { $API_SECRET_KEY = 'abc'; $method = $request-&gt;method(); $url = $request-&gt;path(); $date = $request-&gt;header('x-api-date'); $client_key = $request-&gt;header('x-api-key'); $client_signature = $request-&gt;header('x-api-signature'); $message = $method . $url . $date; $hmac = base64_encode(hash_hmac('sha512', $message, base64_decode($API_SECRET_KEY), true)); $all['x-api-date'] = $date; $all['x-api-signature'] = $client_signature; $all['x-api-key'] = $client_key; Log::error($client_signature); Log::error($hmac); return $next($request); } </code></pre> <p>My last outputs:</p> <pre><code>[2018-07-10 14:23:57] local.ERROR: D0xis7BbxLBg6eWBlIT0ZSnhzk4c3Z3Ore9B16bNZow8xoinfM1zuMlS+lZ6pcOqRRHuupodUVFAIHfv89v4xw== [2018-07-10 14:23:57] local.ERROR: Uypk5ZAd/I6E6sMi9UjIMyMxVhuQm7MatZbKCcGjGjsE2JqqrvTRYuJAR/SSde10eHAkPIz0g24CSZp0G+833A== </code></pre> <p>Can someone explain to me what I am doing wrong? I made sure to use base64 encoding/decoding and made sure the values passed into the hmac function were the same as the headers.</p> <p>I appreciate any help!</p> </div>

在php中重新创建java hmac函数

<div class="post-text" itemprop="text"> <p><strong>This is the have code which i am currently looking into</strong></p> <pre><code>package com.security; import java.util.Map; import javax.xml.bind.DatatypeConverter; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Iterator; public class Signature { private static final String HMAC_SHA256 = "HmacSHA256"; private static final String SECRET_KEY = "LF8np6Lk0PvQ8yQvOnsqvC5WOnRbLOEadpZOAYd22QNdXnSKI08VXfo6Kl0yV5wx"; public static String sign(Map&lt;String,String&gt; params) throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException { return sign(buildDataToSign(params), SECRET_KEY).trim(); } private static String sign(String data, String secretKey) throws InvalidKeyException, NoSuchAlgorithmException, UnsupportedEncodingException { SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(), HMAC_SHA256); Mac mac = Mac.getInstance(HMAC_SHA256); mac.init(secretKeySpec); byte[] rawHmac = mac.doFinal(data.getBytes("UTF-8")); return DatatypeConverter.printBase64Binary(rawHmac).replace(" ", "").trim(); } private static String buildDataToSign(Map&lt;String,String&gt; params) { String[] signedFieldNames = String.valueOf(params.get("signed_fields")).split(","); ArrayList&lt;String&gt; dataToSign = new ArrayList&lt;String&gt;(); for (String signedFieldName : signedFieldNames) { dataToSign.add(signedFieldName + "=" + String.valueOf(params.get(signedFieldName)).trim()); } return commaSeparate(dataToSign); } private static String commaSeparate(ArrayList&lt;String&gt; dataToSign) { StringBuilder csv = new StringBuilder(); for (Iterator&lt;String&gt; it = dataToSign.iterator(); it.hasNext(); ) { csv.append(it.next()); if (it.hasNext()) { csv.append(","); } } return csv.toString(); } } </code></pre> <p>Here i understand that <code>hmac</code> ashing mechanism is being used and it generates <code>base64</code> like string in the end.</p> <p>I am planning to recreate the code in php which suppose to deliver the same output, can someone please explain what's actually happening here.</p> <p>Thanks in advance.</p> <p>At the end the above code generates a random string like:</p> <blockquote> <p>gPRbQMzGGu4ShTwS1NzhzObRWLuGuxvKJuVpSpOaFZk=</p> </blockquote> </div>

从hmac函数中得不到输出

<div class="post-text" itemprop="text"> <p>I want to use hmac to authenticate a user by email The hmac will be stored in the database along with the userid.</p> <ul> <li>Do I also need to store the <code>$payload</code> for decryption as well?</li> </ul> <p>Am I doing it right? </p> <p>I don't get any string in the url querystring?</p> <p>This is my testpage with the following</p> <pre><code>$secret = "dfjhglkhniuh65645"; $payload= "234|somedata"; $hmac = hash_hmac("sha2", $payload, $secret, true); //$hmac = base64_encode($hmac); if (! function_exists("hash_hmac")) { echo "hmac function does not exist"; } $uri="test.php?hash=$hmac"; if(!isset($_GET['hash'])){ header('location: ' . $uri); exit(); } echo "testpage&lt;br&gt;&lt;br&gt;"; if(isset($_GET['hash']) &amp;&amp; !empty($_GET['hash'])) { $sig = $_GET['hash']; $expected_sig = hash_hmac("sha2", $payload, $secret, true); if($expected_sig === $sig)echo "verification succeeded"; } </code></pre> </div>

如何在PHP上使用hash_hmac()和“SHA256withRSA”?

<div class="post-text" itemprop="text"> <p>I'm trying to get PayPal Webhooks to work with my PHP app. The problem is the hashing algorithm they send via headers, that i must use to verify if the request is valid. </p> <p>When I try to use it, I get this error:</p> <pre><code>hash_hmac(): Unknown hashing algorithm: SHA256withRSA </code></pre> <p>I have tried hash_hmac using just the "sha256" algo and it worked, so I think the problem must be with the one they want me to use.</p> <p>Here is the code I use to process the Webhook:</p> <pre><code>$headers = apache_request_headers(); $body = @file_get_contents('php://input'); $json = json_decode($body); // Concatanate the reqired strings values $sigString = $headers['PAYPAL-TRANSMISSION-ID'].'|'.$headers['PAYPAL-TRANSMISSION-TIME'].'|'.$json-&gt;id.'|'.crc32($body); // Get the certificate file and read the key $pub_key = openssl_pkey_get_public(file_get_contents($headers['PAYPAL-CERT-URL'])); $keyData = openssl_pkey_get_details($pub_key); // check signature if ($headers['PAYPAL-TRANSMISSION-SIG'] != hash_hmac($headers['PAYPAL-AUTH-ALGO'],$sigString,$keyData['key'])) { //invalid } </code></pre> </div>

SHA1秘密编码,等效于PHP hash_hmac

<div class="post-text" itemprop="text"> <p>I have the following PHP function</p> <pre><code>public function encodePassword($raw, $salt) { return hash_hmac('sha1', $raw . $salt, $this-&gt;secret); } </code></pre> <p>which I need to translate to Go. I found the following example, but it doesn't involve secret key. <a href="https://gobyexample.com/sha1-hashes" rel="nofollow noreferrer">https://gobyexample.com/sha1-hashes</a></p> <p>How can I create a function in Go, that produces exactly same result as PHP's hash_hmac?</p> <blockquote> <p>Update: After Leo's answer, found this resource with hmac examples in many languages: <a href="https://github.com/danharper/hmac-examples" rel="nofollow noreferrer">https://github.com/danharper/hmac-examples</a>. Can be useful to somebody.</p> </blockquote> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

将一个接口响应时间从2s优化到 200ms以内的一个案例

一、背景 在开发联调阶段发现一个接口的响应时间特别长,经常超时,囧… 本文讲讲是如何定位到性能瓶颈以及修改的思路,将该接口从 2 s 左右优化到 200ms 以内 。 二、步骤 2.1 定位 定位性能瓶颈有两个思路,一个是通过工具去监控,一个是通过经验去猜想。 2.1.1 工具监控 就工具而言,推荐使用 arthas ,用到的是 trace 命令 具体安装步骤很简单,大家自行研究。 我的使用步骤是...

学历低,无法胜任工作,大佬告诉你应该怎么做

微信上收到一位读者小涛的留言,大致的意思是自己只有高中学历,经过培训后找到了一份工作,但很难胜任,考虑要不要辞职找一份他能力可以胜任的实习工作。下面是他留言的一部分内容: 二哥,我是 2016 年高中毕业的,考上了大学但没去成,主要是因为当时家里经济条件不太允许。 打工了三年后想学一门技术,就去培训了。培训的学校比较垃圾,现在非常后悔没去正规一点的机构培训。 去年 11 月份来北京找到了一份工...

JVM内存结构和Java内存模型别再傻傻分不清了

JVM内存结构和Java内存模型都是面试的热点问题,名字看感觉都差不多,网上有些博客也都把这两个概念混着用,实际上他们之间差别还是挺大的。 通俗点说,JVM内存结构是与JVM的内部存储结构相关,而Java内存模型是与多线程编程相关,本文针对这两个总是被混用的概念展开讲解。 JVM内存结构 JVM构成 说到JVM内存结构,就不会只是说内存结构的5个分区,而是会延展到整个JVM相关的问题,所以先了解下

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Google 与微软的浏览器之争

浏览器再现“神仙打架”。整理 | 屠敏头图 | CSDN 下载自东方 IC出品 | CSDN(ID:CSDNnews)从 IE 到 Chrome,再从 Chrome 到 Edge,微软与...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

立即提问
相关内容推荐